finamp
finamp copied to clipboard
Prevent downloading of duplicate images
It would be nice if the downloader would not download duplicate images and just download one image for the entire album. This would save on space and download time.
The current implementation downloads an image if it is "unique" to the item. For songs, this means whether or not the song has an embedded image. This can cause a lot of cases where an item has an embedded image which is the same as the album. I'll have a look to see whether or not there's a robust way of checking whether an image is the same or not.
Sorry if my understanding is incorrect, but if you have access to the image from jellyfin couldnt you create or check the hash of the image then check it against any images of that album? The hash would be the same if the data within the image is the same pixel for pixel meaning any unique images would be downloaded but any duplicates would be left behind. Or even something as simple as just using the album image as the image for each song from that album.
I could do that, although that would take a lot of data, time, and CPU power. We check if the song has its own image as in some cases each song actually has its own image that is different from the image (none of my songs do this, but it's a thing apparently).
If I were to implement this now, I would check against the images' blur hashes. This is a small string used to make the blurred previews that you get in Jellyfin Web before the image has loaded in. I'm not sure if Jellyfin keeps the full image hash, but if the blur hashes are the same they're effectively the same image.
Well that sounds great. It also means that like single pixel differences wont be taken into account which makes bucket loads of sense.
Also, where on earth are people finding albums with seperate images for each song???
Also, where on earth are people finding albums with seperate images for each song???
Those are the fun issues you have to deal with once your app gets a few users 🙃
I think another usecase was times where an album wouldn't have art but each song had an embedded image, and old versions of the app would only look for the album art without checking if the song had its own art
I reckon you've implemented it pretty well to do both things. I'll leave this issue alone for now so it doesn't get cluttered unnecessarily.
This has been added, and will be in the next release :)
This has been implemented by indexing images by blurhash, which is a hash of the image which can be used to show blurred previews with very little bandwidth. When you update, duplicate images will be deleted by removing images that share a blurhash.
(note for future self: I probably need to merge requiredBy
s when migrating)