Bug 415235

Summary: Cover art for certain songs/albums doesn't load.
Product: [Applications] Elisa Reporter: Noah Westervelt <nwestervelt>
Component: generalAssignee: Matthieu Gallien <matthieu_gallien>
Status: RESOLVED NOT A BUG    
Severity: minor CC: nate
Priority: NOR    
Version: 19.12.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: A screenshot of elisa, with some of the affected songs/albums on screen.

Description Noah Westervelt 2019-12-16 06:11:25 UTC
SUMMARY
Cover art doesn't load for certain songs/albums. I already checked the metadata for the affected songs/albums to see if they have cover art associated with them, and they do.

STEPS TO REPRODUCE
1. Open elisa
2. Browse your library (mine has 670 tracks)

OBSERVED RESULT
Cover art doesn't load for certain songs/albums. It's always the same songs/albums that are affected between application restarts.

EXPECTED RESULT
Song/album cover art loads correctly.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon 5.17
(available in About System)
KDE Plasma Version: 5.17.4
KDE Frameworks Version: 5.65.0
Qt Version: 5.13.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2020-01-01 22:45:26 UTC
Could you attach one of the songs for which the art doesn't load?
Comment 2 Noah Westervelt 2020-01-01 23:19:55 UTC
(In reply to Nate Graham from comment #1)
> Could you attach one of the songs for which the art doesn't load?

Since the song files are all too big to attach, I uploaded them to my google drive. Here's the share links to two of the songs for which cover art doesn't load:
     https://drive.google.com/open?id=1eWH63pXotc-T_E9xKiP7Q6FsxcXJf-0g
     https://drive.google.com/open?id=1Kah3YmiSRIuUu1KWzDGR2jcxx-L4Kf98
You should be able to download the files from these links. If you can't, I'll need to find some other method of sharing files.
Comment 3 Nate Graham 2020-01-03 17:33:13 UTC
Works fine for me with those songs, weird.

Is the album art displayed in Dolphin?
Comment 4 Noah Westervelt 2020-01-03 22:00:08 UTC
Created attachment 124884 [details]
A screenshot of elisa, with some of the affected songs/albums on screen.
Comment 5 Matthieu Gallien 2020-01-03 22:07:16 UTC
(In reply to Nate Graham from comment #3)
> Works fine for me with those songs, weird.
> 
> Is the album art displayed in Dolphin?

If it works in Dolphin but not in Elisa, it may be because too much data is cached in Elisa music database and that data is out of sync.

It could be possible to check that if you have some graphical software able to read SQLite databases. I can provide the database request to execute.
Comment 6 Noah Westervelt 2020-01-03 22:22:23 UTC
(In reply to Nate Graham from comment #3)
> Works fine for me with those songs, weird.
> 
> Is the album art displayed in Dolphin?

Yes, the album art displays correctly in Dolphin. It also displays correctly in Cantata and VLC.

I think this might have something to do with Baloo, but I don't know how to check my suspicions.(In reply to Matthieu Gallien from comment #5)
> (In reply to Nate Graham from comment #3)
> > Works fine for me with those songs, weird.
> > 
> > Is the album art displayed in Dolphin?
> 
> If it works in Dolphin but not in Elisa, it may be because too much data is
> cached in Elisa music database and that data is out of sync.
> 
> It could be possible to check that if you have some graphical software able
> to read SQLite databases. I can provide the database request to execute.

It does display correctly in Dolphin, it also works in VLC and Cantata.

I do have 671 tracks in my music library, and I installed something called 'DB Browser for SQLite'. I'll check it if you provide me with instructions.
Comment 7 Nate Graham 2020-01-04 03:19:45 UTC
Your screenshot shows that Elisa thinks it has some album art (or else it would be showing the generic disc icon instead), but it isn't displaying it for some odd reason. Does manually refreshing your music collection help?
Comment 8 Noah Westervelt 2020-01-04 06:48:14 UTC
(In reply to Nate Graham from comment #7)
> Your screenshot shows that Elisa thinks it has some album art (or else it
> would be showing the generic disc icon instead), but it isn't displaying it
> for some odd reason. Does manually refreshing your music collection help?

Manually refreshing the music collection doesn't change anything. I assume that by manually refreshing the collection your referring to opening the 'Application Menu' at the top right of the elisa player, then clicking on 'Refresh Music Collection,' which is what I did.

I also tried removing the album information from the metadata of the songs, and that didn't change anything either.

Sorry for the poor formatting of comment#6, I'm new to this website and got confused for a moment when I was typing that comment.
Comment 9 Matthieu Gallien 2020-01-05 21:05:32 UTC
Thanks for the info and test data.

I also cannot reproduce yet your issue.

Could you please execute the following queries (in 'Execute SQL' tab after opening database file in the following path $HOME/.local/share/elisa/elisaDatabase.db) ?

* "select * from Albums where Title = 'Looking Glass (feat. Bien)';"
* "select * from Tracks where Title = 'Looking Glass (feat. Bien)';"

Thanks
Comment 10 Noah Westervelt 2020-01-06 03:08:13 UTC
(In reply to Matthieu Gallien from comment #9)
> Thanks for the info and test data.
> 
> I also cannot reproduce yet your issue.
> 
> Could you please execute the following queries (in 'Execute SQL' tab after
> opening database file in the following path
> $HOME/.local/share/elisa/elisaDatabase.db) ?
> 
> * "select * from Albums where Title = 'Looking Glass (feat. Bien)';"
> * "select * from Tracks where Title = 'Looking Glass (feat. Bien)';"
> 
> Thanks

The output of those queries is:
   ID=2718
   FileName=file:///home/noah/Music/Synthion/Synthion - Looking Glass (feat. Bien)/Synthion - Looking Glass (feat. Bien).flac
   Priority=1
   Title=Looking Glass (feat. Bien)
   ArtistName=Synthion
   AlbumTitle=Looking Glass (feat. Bien)
   AlbumArtistName=Null (italicized)
   AlbumPath=/home/noah/Music/Synthion/Synthion - Looking Glass (feat. Bien)/
   TrackNumber=Null (italicized)
   DiscNumber=Null (italicized)
   Duration=234000
   Rating=0
   Genre=Null (italicized)
   Composer=Null (italicized)
   Lyricist=Null (italicized)
   Comment=Visit http://dreamscape.bandcamp.com
   Year=2017
   Channels=2
   BitRate=1588000
   SampleRate=44100
   HasEmbeddedCover=1

I hope this helps you figure it out, I don't quite understand what this would have to do with the bug though.
Comment 11 Noah Westervelt 2020-01-09 01:59:22 UTC
Update:
I believe I have discovered the cause of this bug. For whatever reason, whenever the database for elisa says that there's a cover image in the album table, it won't display the cover image for certain albums. I like to keep a file in the directory where the contents of the album are kept called 'cover.png', and it's just an image of the album's cover art. For those albums that don't display correctly, if I remove the 'cover.png' file and then refresh the music collection in elisa, it will sometimes fix it. Other times, I have to close elisa and go into the database and manually write the change to fix it.

For example, in the screenshot you can see that 'Looking Glass (feat. Bien) by Synthion' isn't displaying correctly. In the database, it says that there's a cover image for that album located at file:///home/noah/Music/Synthion/Synthion - Looking Glass (feat. Bien)/cover.png. For that particular album, if I just remove the cover.png file, then refresh elisa, it works correctly.

That doesn't always fix it though. If you look near the bottom of the screenshot, you'll see that the album titled 'Promenade' is also not displaying correctly. For this one, I had to remove the cover file and delete the cover image pathway from the database manually, then restart elisa, to make it work normally.

I don't know why this was happening, but I thought I'd share what I found out here.
Comment 12 Noah Westervelt 2020-01-16 00:53:08 UTC
After looking at my files more; I realized that the albums not displaying their album art correctly have cover images in their directories with .png appended to the end of their file names, but the images themselves are formatted as JPEG images. Fixing this so that the image file's extension matches the format of the image resolves the issue. This was my mistake, I'll close the bug now.

Sorry for wasting your time over a problem I unknowingly created.
Comment 13 Nate Graham 2020-01-17 14:36:00 UTC
No worried, it happens to the best of us. :)