summaryrefslogtreecommitdiffstats
path: root/src/sources
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2021-06-17 11:05:18 +0200
committerGitHub <noreply@github.com>2021-06-17 11:05:18 +0200
commit20cfad293f513584a8332f7cec97c276453ac97e (patch)
treec5dbc034b02f91b943238fcb0c140157a4152f11 /src/sources
parented6ab125197428ac8a38092f461f317643d3e8e1 (diff)
parentde3999305cce5555fcd1d4a056e34793c83dd6f8 (diff)
Merge pull request #3978 from uklotzde/source-synchronized-timestamp
DB v37: Synchronize file modified time with track source on metadata import/export
Diffstat (limited to 'src/sources')
-rw-r--r--src/sources/metadatasourcetaglib.cpp8
-rw-r--r--src/sources/soundsourceproxy.cpp10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/sources/metadatasourcetaglib.cpp b/src/sources/metadatasourcetaglib.cpp
index 607e9881cf..85e09f49a1 100644
--- a/src/sources/metadatasourcetaglib.cpp
+++ b/src/sources/metadatasourcetaglib.cpp
@@ -75,20 +75,20 @@ class AiffFile : public TagLib::RIFF::AIFF::File {
}
};
-inline QDateTime getMetadataSynchronized(const QFileInfo& fileInfo) {
- return fileInfo.lastModified();
+inline QDateTime getSourceSynchronizedAt(const QFileInfo& fileInfo) {
+ return fileInfo.lastModified().toUTC();
}
} // anonymous namespace
std::pair<MetadataSourceTagLib::ImportResult, QDateTime>
MetadataSourceTagLib::afterImport(ImportResult importResult) const {
- return std::make_pair(importResult, getMetadataSynchronized(QFileInfo(m_fileName)));
+ return std::make_pair(importResult, getSourceSynchronizedAt(QFileInfo(m_fileName)));
}
std::pair<MetadataSourceTagLib::ExportResult, QDateTime>
MetadataSourceTagLib::afterExport(ExportResult exportResult) const {
- return std::make_pair(exportResult, getMetadataSynchronized(QFileInfo(m_fileName)));
+ return std::make_pair(exportResult, getSourceSynchronizedAt(QFileInfo(m_fileName)));
}
std::pair<MetadataSource::ImportResult, QDateTime>
diff --git a/src/sources/soundsourceproxy.cpp b/src/sources/soundsourceproxy.cpp
index 69d94ea198..cc77323401 100644
--- a/src/sources/soundsourceproxy.cpp
+++ b/src/sources/soundsourceproxy.cpp
@@ -539,9 +539,9 @@ bool SoundSourceProxy::updateTrackFromSource(
// values if the corresponding file tags are missing. Depending
// on the file type some kind of tags might even not be supported
// at all and this information would get lost entirely otherwise!
- bool metadataSynchronized = false;
+ bool headerParsed = false;
mixxx::TrackMetadata trackMetadata =
- m_pTrack->getMetadata(&metadataSynchronized);
+ m_pTrack->getMetadata(&headerParsed);
// Save for later to replace the unreliable and imprecise audio
// properties imported from file tags (see below).
@@ -559,7 +559,7 @@ bool SoundSourceProxy::updateTrackFromSource(
// if the user did not explicitly choose to (re-)import metadata
// explicitly from this file.
bool mergeExtraMetadataFromSource = false;
- if (metadataSynchronized && mode == UpdateTrackFromSourceMode::Once) {
+ if (headerParsed && mode == UpdateTrackFromSourceMode::Once) {
// No (re-)import needed or desired, only merge missing properties
mergeExtraMetadataFromSource = true;
} else {
@@ -592,7 +592,7 @@ bool SoundSourceProxy::updateTrackFromSource(
<< "from file"
<< getUrl().toString();
// make sure that the trackMetadata was not messed up due to the failure
- trackMetadata = m_pTrack->getMetadata(&metadataSynchronized);
+ trackMetadata = m_pTrack->getMetadata(&headerParsed);
}
// Partial import
@@ -610,7 +610,7 @@ bool SoundSourceProxy::updateTrackFromSource(
}
// Full import
- if (metadataSynchronized) {
+ if (headerParsed) {
// Metadata has been synchronized successfully at least
// once in the past. Only overwrite this information if
// new data has actually been imported, otherwise abort