picard icon indicating copy to clipboard operation
picard copied to clipboard

PICARD-187: Support for manually removing cover art

Open ShubhamBhut opened this issue 1 year ago • 7 comments

PICARD-187: Support for manually removing cover art

finishing PICARD-187

Summary

  • This is a…
    • [ ] Bug fix
    • [x] Feature addition
    • [ ] Refactoring
    • [ ] Minor / simple change (like a typo)
    • [ ] Other
  • Describe this change in 1-2 sentences:

Problem

  • JIRA ticket (optional): PICARD-187

Solution

Add support in all formats to allow to delete cover art tags, and modify ImageList to allow to remove desired image from ImageList

Action

ShubhamBhut avatar Mar 24 '24 14:03 ShubhamBhut

I wasn't sure whether the extra test functions (for each format) will be required or not, so they are not added. However I have manually tested with all the audio files in test/data/

ShubhamBhut avatar Mar 24 '24 14:03 ShubhamBhut

@ShubhamBhut I saw your messages about this PR on IRC, please discuss issues here instead

zas avatar Mar 25 '24 09:03 zas

@ShubhamBhut I saw your messages about this PR on IRC, please discuss issues here instead

Ok. I think I rushed a little and missed an important part : Basically, as I mentioned, the thumbnail is not updating in case of tag removal. I tried clearing pixmap_cache, and setting self.cover_art with a newly created CoverArtThumbnail but they didn't work. I think set_item() should have updated the image change. To be honest, now I am a bit lost on what part of the code is responsible for still displaying the deleted image in the thumbnail.

ShubhamBhut avatar Mar 25 '24 09:03 ShubhamBhut

To be honest, now I am a bit lost on what part of the code is responsible for still displaying the deleted image in the thumbnail.

Keep in mind the displayed image is just a visual thing, a pixmap, so it has to be updated after the actual image was removed from metadata, but some care is needed because the same image might be used multiple times (in various tracks, or albums).

Have a look at https://github.com/metabrainz/picard/blob/7d97ff12043b80d8e9bad80423e6d8d2effacd71/picard/util/imagelist.py#L273C1-L286

zas avatar Mar 25 '24 14:03 zas

Apologies for such late follow up, I tried a lot of different implementations. Now deletion seems to be done perfectly. But the thumbnail update still remains. For some reason, self.cover_art.set_metadata(metadata), sets the metadata correctly but it is overwritten by something else and the thumbnail goes back to the (deleted) cover art image.

ShubhamBhut avatar Mar 29 '24 07:03 ShubhamBhut

Added PICARD-2865 to cover updating the documentation.

rdswift avatar Apr 18 '24 14:04 rdswift

@ShubhamBhut, you should probably update the PICARD-187 ticket to show it being assigned to you so nobody else accidentally starts working on it.

rdswift avatar Apr 18 '24 14:04 rdswift