Use media_duplicates module as dependency for hash duplicate checking

Created on 31 January 2024, 11 months ago
Updated 1 February 2024, 11 months ago

Problem/Motivation

Currently, we are automatically creating hashes to avoid duplicate media based on the given field name. Meaning, the hashes are only created for media files, which are being used on entities using the specified field. But any other media residing in a DIFFERENT media reference field not specified will be ignored, making the whole "reuse existing media instead of creating a duplicate" functionality currently obsolete.

Instead of crawling the media through some fields, we should simply get all media entities and create a hash from their attached file. BUT since the hash creation currently resides in the "copy" method, which gets called on every drush filefield-to-media:copy execution, the crawling should be done through a seperate drush command, since most of the time, we need to run the drush filefield-to-media:copy multiple times, and creating hashes each time, is simply too much unnecessary overhead.

Steps to reproduce

Proposed resolution

Add drush command for creating media hashes on specified fields per entity type.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024