Skip to content

Use the storage layer when backfilling media file sizes #121

@javihgil

Description

@javihgil

Problem

The migration/update path calculates missing file sizes from the media URL instead of using the storage driver.

Current code:

  • src/EntityManager/MediaManager.php:189 checks getFileSize()
  • src/EntityManager/MediaManager.php:191 calls filesize($version->getUrl())

Impact

This is fragile for non-local storage:

  • remote URLs may not work with filesize() at all
  • storage backends are bypassed even though the same method already uses the storage driver to download files for SHA1 calculation
  • migrations can leave versions without size information or fail unpredictably depending on the backend

Expected behavior

  • obtain file size through the storage layer
  • avoid direct filesystem assumptions when the version points to remote storage
  • add coverage for at least one non-local storage scenario

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions