Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoverArtUtils: Fix Reload From File/Folder, Updates Wrong Cover Art #4909

Merged
merged 2 commits into from
Aug 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/library/coverartutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,18 @@ CoverInfoRelative CoverArtUtils::selectCoverArtForTrack(
// TODO(XXX) Sort instead so that we can fall-back if one fails to
// open?
foreach (const QFileInfo& file, covers) {
const QString coverBaseName = file.baseName();
const QString coverBaseName = file.completeBaseName();
if (bestType > TRACK_BASENAME &&
coverBaseName.compare(trackFile.baseName(),
Qt::CaseInsensitive) == 0) {
coverBaseName.compare(trackFile.completeBaseName(),
Qt::CaseInsensitive) == 0) {
bestInfo = &file;
// This is the best type (TRACK_BASENAME) so we know we're done.
break;
} else if (bestType > TRACK_BASENAME &&
coverBaseName.compare(trackFile.fileName(),
Qt::CaseInsensitive) == 0) {
bestType = TRACK_BASENAME;
bestInfo = &file;
daschuer marked this conversation as resolved.
Show resolved Hide resolved
} else if (bestType > ALBUM_NAME &&
coverBaseName.compare(albumName,
Qt::CaseInsensitive) == 0) {
Expand Down