From bd4eec4527aba3b55721993c60d3e32d01afd9cd Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 18 Oct 2021 00:39:26 +0200 Subject: [PATCH] Song: Only merge user set playcount and rating if set Fixes #790 --- src/core/song.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/song.cpp b/src/core/song.cpp index 14933f3fc..1e70ccde6 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -1680,12 +1680,18 @@ void Song::ToXesam(QVariantMap *map) const { void Song::MergeUserSetData(const Song &other) { - set_playcount(other.playcount()); + if (other.playcount() > 0) { + set_playcount(other.playcount()); + } + + if (other.rating() > 0) { + set_rating(other.rating()); + } + set_skipcount(other.skipcount()); set_lastplayed(other.lastplayed()); set_art_manual(other.art_manual()); set_compilation_on(other.compilation_on()); set_compilation_off(other.compilation_off()); - set_rating(other.rating()); }