Skip to content

fix: refine automatic album art detection in generic folders#2069

Open
hthienloc wants to merge 1 commit intostrawberrymusicplayer:masterfrom
hthienloc:fix-image-fetching-non-music-folders
Open

fix: refine automatic album art detection in generic folders#2069
hthienloc wants to merge 1 commit intostrawberrymusicplayer:masterfrom
hthienloc:fix-image-fetching-non-music-folders

Conversation

@hthienloc
Copy link
Copy Markdown

Description

This PR refines the automatic album art detection logic in Song::InitArtAutomatic to prevent unrelated images from being picked up when music files are stored in generic system folders.

Motivation

When a user plays a song from a folder like Downloads, Desktop, or Documents, Strawberry would often pick the first available image in that folder as the album art. This results in incorrect and distracting cover art (e.g., screenshots or downloaded icons) being assigned to songs.

Changes

  • Added a check to identify if a song's directory is a standard system location (Downloads, Desktop, Documents, or Home).
  • Priority Matching: When scanning for images, the logic now explicitly prioritizes standard cover art filenames (cover, front, folder, albumart, album).
  • Fallback Restriction: The "take any image" fallback is now disabled if the song is in a generic system folder. In dedicated music folders, the existing fallback behavior remains unchanged to preserve user workflows.

Testing

  • Verified that arbitrary images in ~/Downloads are no longer picked up as album art.
  • Verified that standard filenames (e.g., cover.jpg) are still detected in ~/Downloads.
  • Verified that the fallback still works in non-system folders.

Prioritize known cover art filenames (cover, front, folder, etc.) and
disable the 'take any image' fallback logic when music files are
located in generic system folders like Downloads or Desktop.

This prevents unrelated images from being incorrectly assigned as
album art.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant