Subsonic: use file added info for 'created' fields, ref #601

This commit is contained in:
emeric
2025-01-25 14:44:49 +01:00
parent 8c11bef1b6
commit e553e840d3
5 changed files with 73 additions and 3 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ namespace lms::api::subsonic
trackResponse.setAttribute("duration", std::chrono::duration_cast<std::chrono::seconds>(track->getDuration()).count());
trackResponse.setAttribute("bitRate", (track->getBitrate() / 1000));
trackResponse.setAttribute("type", "music");
trackResponse.setAttribute("created", core::stringUtils::toISO8601String(track->getLastWritten()));
trackResponse.setAttribute("created", track->getAddedTime().toISO8601String());
trackResponse.setAttribute("contentType", av::getMimeType(track->getAbsoluteFilePath().extension()));
if (const auto rating{ core::Service<feedback::IFeedbackService>::get()->getRating(context.user->getId(), track->getId()) })
trackResponse.setAttribute("userRating", *rating);