From 18a67e1f209358e7cef1a8fbcc1309022716de43 Mon Sep 17 00:00:00 2001 From: Edgar Salgado <977612+esalgado@users.noreply.github.com> Date: Mon, 4 Jan 2021 19:43:43 +0000 Subject: [PATCH] =?UTF-8?q?Last.fm=20last=20played=20date=20import:=20chan?= =?UTF-8?q?ge=20date=20if=20it=20is=20newer=20than=20the=20=E2=80=A6=20(#6?= =?UTF-8?q?25)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- src/collection/collectionbackend.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/collection/collectionbackend.cpp b/src/collection/collectionbackend.cpp index 83f1afa7d..aada2c2ec 100644 --- a/src/collection/collectionbackend.cpp +++ b/src/collection/collectionbackend.cpp @@ -1380,6 +1380,9 @@ void CollectionBackend::UpdateLastPlayed(const QString &artist, const QString &a QSqlDatabase db(db_->Connect()); for (const Song &song : songs) { + if (song.lastplayed() >= lastplayed) { + continue; + } QSqlQuery q(db); q.prepare(QString("UPDATE %1 SET lastplayed = :lastplayed WHERE ROWID = :id").arg(songs_table_)); q.bindValue(":lastplayed", lastplayed);