Ignore Radio Paradise "commercial" break for cover and lyrics search

This commit is contained in:
Jonas Kvinge
2020-09-10 17:17:55 +02:00
parent b756bccc7a
commit 48e0e6af71
2 changed files with 15 additions and 0 deletions

View File

@@ -81,6 +81,12 @@ void AlbumCoverFetcherSearch::TerminateSearch() {
void AlbumCoverFetcherSearch::Start(CoverProviders *cover_providers) {
// Ignore Radio Paradise "commercial" break.
if (request_.artist.toLower() == "commercial-free" && request_.title.toLower() == "listener-supported") {
TerminateSearch();
return;
}
QList<CoverProvider*> cover_providers_sorted = cover_providers->List();
std::stable_sort(cover_providers_sorted.begin(), cover_providers_sorted.end(), ProviderCompareOrder);
@@ -204,6 +210,9 @@ void AlbumCoverFetcherSearch::ProviderSearchResults(CoverProvider *provider, con
)) {
results_copy[i].score_match -= 1;
}
else if (request_album.isEmpty() && result_album.contains("soundtrack")) {
results_copy[i].score_match -= 0.5;
}
// Set the initial image quality score besed on the size returned by the API, this is recalculated when the image is received.
results_copy[i].score_quality += ScoreImage(results_copy[i].image_size);

View File

@@ -56,6 +56,12 @@ void LyricsFetcherSearch::TerminateSearch() {
void LyricsFetcherSearch::Start(LyricsProviders *lyrics_providers) {
// Ignore Radio Paradise "commercial" break.
if (request_.artist.toLower() == "commercial-free" && request_.title.toLower() == "listener-supported") {
TerminateSearch();
return;
}
QList<LyricsProvider*> lyrics_providers_sorted = lyrics_providers->List();
std::stable_sort(lyrics_providers_sorted.begin(), lyrics_providers_sorted.end(), ProviderCompareOrder);