[BUG] Tracks displaying wrong embedded artworks
If there are two or more files that share the same name and they have embedded artwork, all files with the same name will use the artwork of one of the identically named files instead of their respective embedded artwork. I believe this only relates to files with embedded artwork and not folders with "cover" or "folder" images in them, although I have not verified this. This issue is present on three different android devices I have used.
Expected Behavior
Each track should display its respective embedded artwork.
Current Behavior
If I have 3 files called "Song", (referred to as Song 1, 2 and 3 for explanation), each with different artwork, tracks "Song" 2 and "Song" 3 will instead display the artwork of "Song" 1. The incorrect artwork will also be displayed in the media player notification.
Steps to Reproduce
- Have multiple files with same name in music library with their own respective artworks.
- View said files artworks and observe incorrect artworks.
Screenshots
https://github.com/user-attachments/assets/05fa46cb-734d-4fb2-b1d7-a02180fbba3f
The above video shows the problem clearly. You can see the correct artwork for the track is displayed when you open the "edit tags" menu.
Logs
Possible Solution
I would presume cached artwork files are named after the respective file name that the artwork is associated with. When caching artworks (assuming my presumption is correct, I haven't read the code myself), naming them with the schema {title}{artist}{album} would prevent these conflicts in the future.
thats expected behaviour since artworks are saved based on their filename, u can change that by enabling "group artworks by album" and maybe specify "album identifiers"
I would presume cached artwork files are named after the respective file name that the artwork is associated with. When caching artworks (assuming my presumption is correct, I haven't read the code myself), naming them with the schema {title}{artist}{album} would prevent these conflicts in the future.
exactly as u pre assumed, except that i didnt like this as default, since tags can be changed more than filename + for me atleast i have some music with similar tags (nightcore/sped up/slowed/etc), i guess "group artworks by album" would do it for ya, or i guess u should name ur files properly like for example "[track] artist - title (album)", lemme know if i missed smth or if u disagree
thats expected behaviour since artworks are saved based on their filename, u can change that by enabling "group artworks by album" and maybe specify "album identifiers"
Noted, thank you!
i guess "group artworks by album" would do it for ya, or i guess u should name ur files properly like for example "[track] artist - title (album)", lemme know if i missed smth or if u disagree
"group artworks by album" solves my original issue but instead creates another. This is a bit of an edge case but this setting doesn't take into account tracks with separate embedded artworks in the same album (presumably by design). I have a few tagged albums where the songs within each have their own different embedded artwork, however with this setting enabled it just uses a random artwork from a song in the album for all the songs in the album. If you'd prefer to keep the naming schema the same for cached artworks, your idea of naming my files more appropriately will suffice, thank you for the suggestion!
"group artworks by album" disabled
"group artworks by album" enabled
I assume this behaviour is intended however. Based on your response, I'll decide if I should just rename my files.
This is a bit of an edge case but this setting doesn't take into account tracks with separate embedded artworks in the same album
thats not edge case i guess, it was requested on discord few days ago, i might or might not look into implementing it (tho it would be pain so idk yet)
I assume this behaviour is intended however. Based on your response, I'll decide if I should just rename my files.
the only solutions we have:
- implement per-track artwork (with group artworks by album)
- use full paths instead of filenames, this will work but will affect performance too much, and also too pain to change it everywhere without breaking smth
- u renaming ur files, i assume this is also too much pain considering how many files u got, but an easy solution for it is using "Auto Tagger" app to auto rename files based on their tags, im sure this would be the easiest and fastest solution for now, lemme know if ur going to use this or need help with it
thats not edge case i guess, it was requested on discord few days ago, i might or might not look into implementing it (tho it would be pain so idk yet)
Guess I'm not alone then haha.
- use full paths instead of filenames, this will work but will affect performance too much, and also too pain to change it everywhere without breaking smth
Could you use file hashes instead i.e you name the cache files with part or all of the hash of a file? How big of a performance hit would there be to calculate file hashes based on files? Maybe you could create the hashes using just the metadata of a track instead?
The above is just an idea, not sure of its potential problems or performance implications.
- u renaming ur files, i assume this is also too much pain considering how many files u got, but an easy solution for it is using "Auto Tagger" app to auto rename files based on their tags, im sure this would be the easiest and fastest solution for now, lemme know if ur going to use this or need help with it
This is pittifully easy for me, don't worry! I use a tool called Tagger which makes bulk metadata editing a breeze.
Could you use file hashes instead
thats what i was refering to, but a hash for file path not the file itself
Maybe you could create the hashes using just the metadata of a track instead?
thats the same but file path would be better
The above is just an idea, not sure of its potential problems or performance implications.
yah its actually used by most players, i just didnt want the overhead of hashing all the time.. or maybe we can hash once and save it with the track details, that could be better but one more reason i used clear names for the file is to easily access them without being tied/hidden to the track file only, for example i can go to artworks folder and know which artwork is for which track etc
I use a tool called Tagger which makes bulk metadata editing a breeze.
thats cool, it looks awesome i will use it for windows. the one i sent u is for android too so we have both options ^^
Any news on the matter?
not yet, i might get into this since pc version is coming and i should think about a unified way to sync both histories/playlists/etc (where path-identified won't make sense)
Bumping this up, as I also have this issue.
@bugreporter005 @Maxitendo1 @ghost (rip) hey guys, just added an option to use unique artwork hash in indexer settings in latest beta https://github.com/namidaco/namida-snapshots/releases
it uses full file path as hash so it might slightttly affect indexing time, u would need to index after enabling tho. sry for taking long!
Thank you very much for the great work @MSOB7YY! But I seem to have an issue with displaying the images. It only seems to be working once for the music files and if I restart the app only the video files have the images, but now the music files have no images.
omg i overlooked the most important part T.T the generated hash was not included while saving to the db should be fixed next update, thanks for pointing it out ^^