Add option for overwriting database rating

This commit is contained in:
Jonas Kvinge
2021-10-31 23:24:32 +01:00
parent b41957ce5c
commit ca10920bb5
7 changed files with 17 additions and 6 deletions

View File

@@ -1680,13 +1680,13 @@ void Song::ToXesam(QVariantMap *map) const {
}
void Song::MergeUserSetData(const Song &other) {
void Song::MergeUserSetData(const Song &other, const bool merge_rating) {
if (other.playcount() > 0) {
set_playcount(other.playcount());
}
if (other.rating() > 0) {
if (merge_rating && other.rating() > 0.0F) {
set_rating(other.rating());
}

View File

@@ -187,7 +187,7 @@ class Song {
// Copies important statistics from the other song to this one, overwriting any data that already exists.
// Useful when you want updated tags from disk but you want to keep user stats.
void MergeUserSetData(const Song &other);
void MergeUserSetData(const Song &other, const bool merge_rating);
// Save
void BindToQuery(SqlQuery *query) const;