SmartPlaylistSearchTerm: Handle unrated (-1) as zero

Fixes #1244
This commit is contained in:
Jonas Kvinge 2023-07-26 01:45:28 +02:00
parent 9ed4bd9366
commit 0bc94b90d7
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ QString SmartPlaylistSearchTerm::ToSql() const {
}
}
else if (TypeOf(field_) == Type::Rating) {
col = "CAST ((" + col + " + 0.05) * 10 AS INTEGER)";
col = "CAST ((replace(" + col + ", -1, 0) + 0.05) * 10 AS INTEGER)";
value = "CAST ((" + value + " + 0.05) * 10 AS INTEGER)";
}