Aggressively look for cover files
ClosedPublic

Authored by ervin on Apr 23 2018, 3:48 PM.

Details

Summary

If you are like me and accumulated music over years, the conventions for
the file names of those changed over time, we need something more
aggressive.

So now it covers (hehe) files containing cover, folder and front in
their name (with upper case initial or not), it also looks for files
containing the album name in their name (with and without spaces).

It still doesn't catch all my covers, but I think we'll need to refactor
that piece of code to do better. That's for another attempt when I get
the time to do a proper results sorting. :-)

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ervin requested review of this revision.Apr 23 2018, 3:48 PM
ervin created this revision.
mgallien accepted this revision.Apr 23 2018, 8:07 PM

I still have some music dating back from when I was in Toulouse. I can understand what you mean ;)
Thanks.

This revision is now accepted and ready to land.Apr 23 2018, 8:07 PM

By the way, which cases still fail for you ?
There is also D12320 to allow reading cover embedded in music tracks.

ervin added a comment.Apr 24 2018, 6:23 AM

The still failing cases I found seem to all revolve around "spaces not in the directory name but in the cover file name", currently my approach can't deal with that correctly. Also in cases of more than one match we don't necessarily pick the best one (yes... in some cases I have more than one match now because it's more aggressive). That's why in the end we probably want to list all jpg and png, score them and sort them based on the score to pick the best one. I'll see if I get to it at some point but for now I went for the simple fixes which remove my biggest pain points. :-)

This revision was automatically updated to reflect the committed changes.