Commit 5d1b080c authored by Matthieu Gallien's avatar Matthieu Gallien

DatabaseInterface::trackHasStartedPlaying notify modified tracks

parent b9211082
......@@ -4600,6 +4600,19 @@ private Q_SLOTS:
musicDb.trackHasStartedPlaying(QUrl::fromLocalFile(QStringLiteral("/$5")), QDateTime::fromSecsSinceEpoch(1536689));
musicDb.trackHasStartedPlaying(QUrl::fromLocalFile(QStringLiteral("/$13")), QDateTime::fromSecsSinceEpoch(1537689));
QCOMPARE(musicDb.allAlbumsData().count(), 5);
QCOMPARE(musicDb.allArtistsData().count(), 7);
QCOMPARE(musicDb.allTracksData().count(), 22);
QCOMPARE(musicDbArtistAddedSpy.count(), 1);
QCOMPARE(musicDbAlbumAddedSpy.count(), 1);
QCOMPARE(musicDbTrackAddedSpy.count(), 1);
QCOMPARE(musicDbArtistRemovedSpy.count(), 0);
QCOMPARE(musicDbAlbumRemovedSpy.count(), 0);
QCOMPARE(musicDbTrackRemovedSpy.count(), 0);
QCOMPARE(musicDbAlbumModifiedSpy.count(), 0);
QCOMPARE(musicDbTrackModifiedSpy.count(), 10);
QCOMPARE(musicDbDatabaseErrorSpy.count(), 0);
auto recentlyPlayedTracksData = musicDb.recentlyPlayedTracksData(10);
QCOMPARE(recentlyPlayedTracksData.count(), 10);
......
......@@ -779,6 +779,10 @@ void DatabaseInterface::trackHasStartedPlaying(const QUrl &fileName, const QDate
}
updateTrackStatistics(fileName, time);
auto trackId = internalTrackIdFromFileName(fileName);
if (trackId != 0) {
Q_EMIT trackModified(internalOneTrackPartialData(trackId));
}
transactionResult = finishTransaction();
if (!transactionResult) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment