Subsonic API: reported correct starred date/time
This commit is contained in:
@@ -32,8 +32,6 @@
|
||||
|
||||
namespace API::Subsonic
|
||||
{
|
||||
static const std::string_view reportedDummyStarredDate{ "2000-01-01T00:00:00" };
|
||||
|
||||
using namespace Database;
|
||||
|
||||
Response::Node createAlbumNode(const Release::pointer& release, Session& dbSession, const User::pointer& user, bool id3)
|
||||
@@ -95,8 +93,8 @@ namespace API::Subsonic
|
||||
}
|
||||
}
|
||||
|
||||
if (Service<Scrobbling::IScrobblingService>::get()->isStarred(user->getId(), release->getId()))
|
||||
albumNode.setAttribute("starred", reportedDummyStarredDate); // TODO report correct date/time
|
||||
if (const Wt::WDateTime dateTime{ Service<Scrobbling::IScrobblingService>::get()->getStarredDateTime(user->getId(), release->getId()) }; dateTime.isValid())
|
||||
albumNode.setAttribute("starred", StringUtils::toISO8601String(dateTime)); // TODO report correct date/time
|
||||
|
||||
return albumNode;
|
||||
}
|
||||
|
||||
@@ -24,13 +24,12 @@
|
||||
#include "services/database/User.hpp"
|
||||
#include "services/scrobbling/IScrobblingService.hpp"
|
||||
#include "utils/Service.hpp"
|
||||
#include "utils/String.hpp"
|
||||
|
||||
#include "SubsonicId.hpp"
|
||||
|
||||
namespace API::Subsonic
|
||||
{
|
||||
static const std::string_view reportedDummyStarredDate{ "2000-01-01T00:00:00" };
|
||||
|
||||
using namespace Database;
|
||||
|
||||
namespace Utils
|
||||
@@ -66,8 +65,8 @@ namespace API::Subsonic
|
||||
artistNode.setAttribute("albumCount", releases.results.size());
|
||||
}
|
||||
|
||||
if (Service<Scrobbling::IScrobblingService>::get()->isStarred(user->getId(), artist->getId()))
|
||||
artistNode.setAttribute("starred", reportedDummyStarredDate); // TODO handle date/time
|
||||
if (const Wt::WDateTime dateTime{ Service<Scrobbling::IScrobblingService>::get()->getStarredDateTime(user->getId(), artist->getId()) }; dateTime.isValid())
|
||||
artistNode.setAttribute("starred", StringUtils::toISO8601String(dateTime));
|
||||
|
||||
return artistNode;
|
||||
}
|
||||
|
||||
@@ -37,8 +37,6 @@ namespace API::Subsonic
|
||||
{
|
||||
using namespace Database;
|
||||
|
||||
static const std::string_view reportedDummyStarredDate{ "2000-01-01T00:00:00" };
|
||||
|
||||
namespace
|
||||
{
|
||||
std::string_view formatToSuffix(AudioFormat format)
|
||||
@@ -143,8 +141,8 @@ namespace API::Subsonic
|
||||
trackResponse.setAttribute("type", "music");
|
||||
trackResponse.setAttribute("created", StringUtils::toISO8601String(track->getLastWritten()));
|
||||
|
||||
if (Service<Scrobbling::IScrobblingService>::get()->isStarred(user->getId(), track->getId()))
|
||||
trackResponse.setAttribute("starred", reportedDummyStarredDate); // TODO handle date/time
|
||||
if (const Wt::WDateTime dateTime{ Service<Scrobbling::IScrobblingService>::get()->getStarredDateTime(user->getId(), track->getId()) }; dateTime.isValid())
|
||||
trackResponse.setAttribute("starred", StringUtils::toISO8601String(dateTime));
|
||||
|
||||
// Report the first GENRE for this track
|
||||
ClusterType::pointer clusterType{ ClusterType::find(dbSession, "GENRE") };
|
||||
|
||||
Reference in New Issue
Block a user