diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2021-06-17 15:04:08 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2021-06-17 15:05:45 +0200 |
commit | 27b75e406e8298ac48a3fdf9a63a8eca70d21444 (patch) | |
tree | 5a5e32d7b937f9b1c5f1b2fc1a8927bb71e2bda0 /src/sources | |
parent | 32b5f7ef4f4a3a15db590591b1c086b8800f078d (diff) |
Track source sync: Ignore bogus file mopdification time stamps
Diffstat (limited to 'src/sources')
-rw-r--r-- | src/sources/metadatasourcetaglib.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/sources/metadatasourcetaglib.cpp b/src/sources/metadatasourcetaglib.cpp index 85e09f49a1..6684e820ef 100644 --- a/src/sources/metadatasourcetaglib.cpp +++ b/src/sources/metadatasourcetaglib.cpp @@ -76,7 +76,14 @@ class AiffFile : public TagLib::RIFF::AIFF::File { }; inline QDateTime getSourceSynchronizedAt(const QFileInfo& fileInfo) { - return fileInfo.lastModified().toUTC(); + const QDateTime lastModifiedUtc = fileInfo.lastModified().toUTC(); + // Ignore bogus values like 1970-01-01T00:00:00.000 UTC + // that are obviously incorrect and don't provide any + // information. + if (lastModifiedUtc.toMSecsSinceEpoch() == 0) { + return QDateTime{}; + } + return lastModifiedUtc; } } // anonymous namespace |