Skip to content

Commit

Permalink
DlgTagFetcher: simplify handling preferred cover image size
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Nov 14, 2023
1 parent c9859b4 commit 607c171
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/library/dlgtagfetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,9 @@ void DlgTagFetcher::slotCoverFound(
}

void DlgTagFetcher::slotStartFetchCoverArt(const QList<QString>& allUrls) {
DlgPrefLibrary::CoverArtFetcherQuality fetcherQuality =
static_cast<DlgPrefLibrary::CoverArtFetcherQuality>(
m_pConfig->getValue(mixxx::library::prefs::kCoverArtFetcherQualityConfigKey,
static_cast<int>(DlgPrefLibrary::CoverArtFetcherQuality::Medium)));
const int fetcherQuality = m_pConfig->getValue(
mixxx::library::prefs::kCoverArtFetcherQualityConfigKey,
static_cast<int>(DlgPrefLibrary::CoverArtFetcherQuality::Medium));

// Cover art links task can retrieve us variable number of links with different cover art sizes
// Every single successful response has 2 links.
Expand All @@ -579,8 +578,8 @@ void DlgTagFetcher::slotStartFetchCoverArt(const QList<QString>& allUrls) {
return;
}

if (allUrls.size() > static_cast<int>(fetcherQuality)) {
getCoverArt(allUrls.at(static_cast<int>(fetcherQuality)));
if (allUrls.size() > fetcherQuality) {
getCoverArt(allUrls.at(fetcherQuality));
} else {
getCoverArt(allUrls.last());
}
Expand Down

0 comments on commit 607c171

Please sign in to comment.