mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-30 00:55:33 +01:00
Dont use empty lyrics from API
This commit is contained in:
parent
124eba6800
commit
91b9602e12
@ -128,8 +128,7 @@ void AuddLyricsProvider::HandleSearchReply(QNetworkReply *reply, const quint64 i
|
|||||||
result.title = json_obj["title"].toString();
|
result.title = json_obj["title"].toString();
|
||||||
if (result.artist.toLower() != artist.toLower() && result.title.toLower() != title.toLower()) continue;
|
if (result.artist.toLower() != artist.toLower() && result.title.toLower() != title.toLower()) continue;
|
||||||
result.lyrics = json_obj["lyrics"].toString();
|
result.lyrics = json_obj["lyrics"].toString();
|
||||||
if (result.lyrics.length() > kMaxLength) continue;
|
if (result.lyrics.isEmpty() || result.lyrics.length() > kMaxLength || result.lyrics == "error") continue;
|
||||||
if (result.lyrics == "error") continue;
|
|
||||||
|
|
||||||
//qLog(Debug) << "AudDLyrics:" << result.artist << result.title << result.lyrics.length();
|
//qLog(Debug) << "AudDLyrics:" << result.artist << result.title << result.lyrics.length();
|
||||||
|
|
||||||
|
@ -102,9 +102,14 @@ void OVHLyricsProvider::HandleSearchReply(QNetworkReply *reply, const quint64 id
|
|||||||
LyricsSearchResult result;
|
LyricsSearchResult result;
|
||||||
result.lyrics = json_obj["lyrics"].toString();
|
result.lyrics = json_obj["lyrics"].toString();
|
||||||
|
|
||||||
qLog(Debug) << "OVHLyrics: Got lyrics for" << artist << title;
|
if (result.lyrics.isEmpty()) {
|
||||||
|
qLog(Debug) << "OVHLyrics: No lyrics for" << artist << title;
|
||||||
emit SearchFinished(id, LyricsSearchResults() << result);
|
emit SearchFinished(id, LyricsSearchResults());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
qLog(Debug) << "OVHLyrics: Got lyrics for" << artist << title;
|
||||||
|
emit SearchFinished(id, LyricsSearchResults() << result);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user