Use ENCODINGTIME to set the added time, if present, otherwise use the last modified time of the file (only during the first import), fixes #595

This commit is contained in:
emeric
2025-01-18 16:51:31 +01:00
parent 5cfbbeca65
commit c73ff7dc03
11 changed files with 65 additions and 8 deletions
+8
View File
@@ -390,6 +390,14 @@ namespace lms::metadata
}
track.advisory = getAdvisory(tagReader);
if (const auto encodingTime{ getTagValueAs<std::string>(tagReader, TagType::EncodingTime) })
{
if (auto dateTime{ core::stringUtils::fromISO8601String(*encodingTime) }; dateTime.isValid())
track.encodingTime = dateTime;
else if (const Wt::WDate date{ utils::parseDate(*encodingTime) }; date.isValid())
track.encodingTime = Wt::WDateTime{ date };
}
track.lyrics = getLyrics(tagReader); // no custom delimiter on lyrics
track.comments = getTagValuesAs<std::string>(tagReader, TagType::Comment, {} /* no custom delimiter on comments */);
track.copyright = getTagValueAs<std::string>(tagReader, TagType::Copyright).value_or("");