Increase lyrics score if lyrics text > 60

This commit is contained in:
Jonas Kvinge
2020-01-02 19:21:27 +01:00
parent 7f442cff3b
commit 443be1c2c8
6 changed files with 13 additions and 0 deletions

View File

@@ -119,6 +119,12 @@ void LoloLyricsProvider::HandleSearchReply(QNetworkReply *reply, const quint64 i
else if (type == QXmlStreamReader::EndElement) {
if (name == "result") {
if (!result.lyrics.isEmpty()) {
if (result.artist.toLower() == artist.toLower())
result.score += 1.0;
if (result.title.toLower() == title.toLower())
result.score += 1.0;
if (result.lyrics.length() > LyricsFetcher::kGoodLyricsLength)
result.score += 1.0;
results << result;
}
result = LyricsSearchResult();