Skip to content

Better cover finding

Jack Hill requested to merge jackh/elisa:better_cover_finding into master

Reason for the change

Build cover file search strings from file name + extension

So we don't have to duplicate the file name string for each extension. Also fixes a bug where we forgot to search for the "jpeg" extension.

If there is a single image in an album folder, use that as the cover file

Might as well use it

Prioritise exact string match when searching for cover files

Sometimes a user might have files such as "Case Cover Back Inner.jpg" and "cover.jpg" in the same music folder. Previously the cover finder would search filter these alphabetically using the glob "*[Cc]over*.jpg" and use the first result as the cover. For this example, we would end up using "Case Cover Back Inner.jpg" which is clearly not the intended cover image.

Now, we prioritise direct matches for "[Cc]over.jpg", "[Cc]over.jpeg" and "[Cc]over.png" before we check the globs. So for our example, the correct cover file would be chosen.

Use the first alphabetically found image file for cover image as a last resort

Might as well show something if none of the previous attempts to find a cover image were successful

Test plan

Updated filescannertest.cpp

Screenshots or screen recordings

Bugs fixed

BUG: 467274

BUG: 470529

CCBUG: 470243

Edited by Jack Hill

Merge request reports