Last.fm last played date import: change date if it is newer than the … (#625)
* Last.fm last played date import: change date if it is newer than the one in database * Last.fm lastplayed: make it more consistent with the code
This commit is contained in:
@@ -1380,6 +1380,9 @@ void CollectionBackend::UpdateLastPlayed(const QString &artist, const QString &a
|
|||||||
QSqlDatabase db(db_->Connect());
|
QSqlDatabase db(db_->Connect());
|
||||||
|
|
||||||
for (const Song &song : songs) {
|
for (const Song &song : songs) {
|
||||||
|
if (song.lastplayed() >= lastplayed) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
QSqlQuery q(db);
|
QSqlQuery q(db);
|
||||||
q.prepare(QString("UPDATE %1 SET lastplayed = :lastplayed WHERE ROWID = :id").arg(songs_table_));
|
q.prepare(QString("UPDATE %1 SET lastplayed = :lastplayed WHERE ROWID = :id").arg(songs_table_));
|
||||||
q.bindValue(":lastplayed", lastplayed);
|
q.bindValue(":lastplayed", lastplayed);
|
||||||
|
|||||||
Reference in New Issue
Block a user