Dont use empty lyrics from API

This commit is contained in:
Jonas Kvinge
2020-12-20 07:09:12 +01:00
parent 124eba6800
commit 91b9602e12
2 changed files with 9 additions and 5 deletions

View File

@@ -102,9 +102,14 @@ void OVHLyricsProvider::HandleSearchReply(QNetworkReply *reply, const quint64 id
LyricsSearchResult result;
result.lyrics = json_obj["lyrics"].toString();
qLog(Debug) << "OVHLyrics: Got lyrics for" << artist << title;
emit SearchFinished(id, LyricsSearchResults() << result);
if (result.lyrics.isEmpty()) {
qLog(Debug) << "OVHLyrics: No lyrics for" << artist << title;
emit SearchFinished(id, LyricsSearchResults());
}
else {
qLog(Debug) << "OVHLyrics: Got lyrics for" << artist << title;
emit SearchFinished(id, LyricsSearchResults() << result);
}
}