diff --git a/src/smartplaylists/smartplaylistsearchterm.cpp b/src/smartplaylists/smartplaylistsearchterm.cpp index 120e3082..727990c3 100644 --- a/src/smartplaylists/smartplaylistsearchterm.cpp +++ b/src/smartplaylists/smartplaylistsearchterm.cpp @@ -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)"; }