Problem/Motivation
It's currently impossible for end-users to manually pull metadata associated with media assets from the source into the Drupal media entity, after the entity is created. Similarly, the Thumbnail (which is not a metadata per se) is treated the same way, it is currently only retrieved from the source when the entity is first created.
Several scenarios have shown this is a big limitation, being a prominent example the situation when the source providing the thumbnail is remote (like an YouTube video), and the thumbnail is changed on the remote source after the entity has been created in Drupal. Currently there is no mechanism for users to update the Thumbnail in this scenario. The same is valid for all other metadata attributes that source plugins could define (name, filesize, filemime, width, height, etc).
This issue was spun-off from #2878119: Whether queued or not, update the media thumbnail and metadata before beginning the entity save database transaction.
Proposed resolution
Expose to the UI the possibility of end users with correct permissions to trigger an immediate update of the asset's metadata + thumbnail
Remaining tasks
- Usability re-review
User interface changes
- New contextual link "Update metadata" is available in the front-end
- New operation dropbutton "Update metadata" is available in the back-end
- New "Update metadata" action is available in media administrative views, as a bulk operation.
API changes
A new public method \Drupal\media\MediaInterface::updateMetadata()
is added to the Media interface.
Data model changes
None
Release notes snippet
Adds the ability for users to manually trigger updating metadata on media entities (e.g. updating a more recent YouTube thumbnail).