Import correctly tracks Media already that exists, but Files still duplicated

Created on 25 June 2024, 6 days ago
Updated 28 June 2024, 3 days ago

Problem/Motivation

When I run Media library import
then I see Media entity already exists. Not creating a new queue item for "file.jpg"
and only new images are added as Media (77 in my case)
but all the existing files are duplicated in Files (all 6716 in my case)

Successive media imports add the files again (my counter stopped at 10000).

From running Audit Files reports, it appears that the newly created records in Files are being created on assets:// paths and pointing to the same files on disk as the existing files, which are on public:// path.

Steps to reproduce

  • At /admin/config/media/media-library-importer, disable "Import files to location set in media"
  • set image files path in import from folder
  • Select media type to import: image
  • Run drush mli
  • view /admin/content/files and observe 6716 news files with 0 use on site

Proposed resolution

Don't add files to Files unless the files are associated with new Media

---

Is this a bug? Is there a way to prevent files from being added to the files list (files_managed) that I'm just not aware of?

πŸ› Bug report
Status

Active

Version

2.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States nateB

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

Comments & Activities

Production build 0.69.0 2024