Shuttle2 icon indicating copy to clipboard operation
Shuttle2 copied to clipboard

Folder based artwork naming improvements

Open timusus opened this issue 3 months ago • 1 comments

Fixes #169

The regex pattern for detecting album art files has been expanded to include common filename variations that were previously not recognized:

  • albumart.jpg/png (iTunes/Windows Media Player standard)
  • front.jpg/png (front cover artwork)
  • artwork.jpg/png (generic artwork files)

These additions complement the existing patterns (folder, cover, album) and maintain support for hidden files (those starting with a dot).

The pattern now matches:

  • folder.jpg, cover.jpg, album.jpg (existing)
  • albumart.jpg, albumartsmall.jpg (new)
  • front.jpg, frontcover.jpg (new)
  • artwork.jpg (new)
  • All with optional leading dot for hidden files

timusus avatar Nov 16 '25 07:11 timusus

I had a look to the changes the other day and saw some room for improvement, so I've gone ahead and done some improvements:

  • Ensure the input stream is closed after use.
  • Extract the common code.
  • Fallback to any image found in the directory if none is found with a standard name. Because, as much as we'd like artwork files to be properly named, the reality is that a lot of times they'll have some other name. For example, a quick search in my library has found images named with several variations of the expected ones, the name of the album, UUIDs, and lots of weird names.

I've pushed the changes to the branch alexm-improve-artowork-detection (rebased to main), if you want to cherry-pick them. Or I can open a separate pull request, if you prefer.

rivaldi8 avatar Jan 06 '26 12:01 rivaldi8