Add option for overwriting database rating
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user