xp icon indicating copy to clipboard operation
xp copied to clipboard

Media Improvements

Open ComLock opened this issue 3 years ago • 3 comments

In the FotoWare integration, when I receive a assetModified webhook, in which the asset has been renamed, I have to rename the attachment in Enonic. The only way I've been able to do this now is in 3 operations.

  1. Remove Attachment
  2. Add Attachment
  3. Modify content and update data.media.attachment

This works but creates 3 versions, of which 2 are "invalid"

Instead a renameMedia function which only creates a single version would be better, but then again it would be even better if I could renameMedia and update other content data in a single function call updateMedia.

So if createContent and modifyContent could do everything regarding media and attachments in addition to what it does not, that would be another option.

  • [ ] updateMedia (takes a new file and/or a new name for the media - fixing all properties with media name) #8754 #9260
  • [ ] Drop storing "filename" in the binary property, this is confusing as we store name in the attachment anyway #9262
  • [ ] renameAttachment (should only rename a specific attachment - no media specific handling)
  • [ ] Ensure content rename handles media, so that the attachment is also renamed during this operation.

ComLock avatar Dec 09 '21 08:12 ComLock

renameAttachment (should only rename a specific attachment - no media specific handling)

renaming of an attachment is more-or-less possible. Bu deleting them and re attaching them. Is it not sufficient?

Ensure content rename handles media, so that the attachment is also renamed during this operation.

How would it help? It is a hassle to support.

rymsha avatar Sep 15 '22 15:09 rymsha

For attatchment renaming, the problem is to keep any attatchmentUploader fields in synch (linked). Do we want to deal with this, if so, how?

sigdestad avatar Sep 16 '22 05:09 sigdestad

For media, I guess we can drop this update - as image URL etc now only uses the media name, not the attatchment. But what does mediaUrl do?

sigdestad avatar Sep 16 '22 05:09 sigdestad