Replaced Json parser with a custom one (optims+compact output)

This commit is contained in:
emeric
2023-10-20 15:22:00 +02:00
parent 4562e0368a
commit d86260ba2d
13 changed files with 316 additions and 181 deletions
+3 -3
View File
@@ -114,7 +114,7 @@ namespace API::Subsonic
if (artists.size() == 1)
{
albumNode.setAttribute(id3 ? "artistId" : "parent", idToString(artists.front()->getId()));
albumNode.setAttribute(id3 ? Response::Node::Key{ "artistId" } : Response::Node::Key{ "parent" }, idToString(artists.front()->getId()));
}
else
{
@@ -140,7 +140,7 @@ namespace API::Subsonic
{
const Wt::WDateTime dateTime{ Service<Scrobbling::IScrobblingService>::get()->getLastListenDateTime(user->getId(), release->getId()) };
albumNode.setAttribute("played", dateTime.isValid() ? StringUtils::toISO8601String(dateTime) : "");
albumNode.setAttribute("played", dateTime.isValid() ? StringUtils::toISO8601String(dateTime) : std::string{ "" });
}
{
@@ -148,7 +148,7 @@ namespace API::Subsonic
albumNode.setAttribute("musicBrainzId", mbid ? mbid->getAsString() : "");
}
auto addClusters{ [&](std::string_view field, std::string_view clusterTypeName)
auto addClusters{ [&](Response::Node::Key field, std::string_view clusterTypeName)
{
albumNode.createEmptyArrayValue(field);