Add option for overwriting playcounts

Fixes #962
This commit is contained in:
Jonas Kvinge
2022-06-05 04:59:50 +02:00
parent 0ee67f186f
commit 6c0b395f4a
7 changed files with 19 additions and 7 deletions

View File

@@ -1541,9 +1541,9 @@ void Song::ToXesam(QVariantMap *map) const {
}
void Song::MergeUserSetData(const Song &other, const bool merge_rating) {
void Song::MergeUserSetData(const Song &other, const bool merge_playcount, const bool merge_rating) {
if (other.playcount() > 0) {
if (merge_playcount && other.playcount() > 0) {
set_playcount(other.playcount());
}

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, const bool merge_rating);
void MergeUserSetData(const Song &other, const bool merge_playcount, const bool merge_rating);
// Save
void BindToQuery(SqlQuery *query) const;