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
@@ -133,7 +133,7 @@ namespace API::Subsonic
throw NotImplementedGenericError{};
Response response{ Response::createOkResponse(context.serverProtocolVersion) };
Response::Node& albumListNode{ response.createNode(id3 ? "albumList2" : "albumList") };
Response::Node& albumListNode{ response.createNode(id3 ? Response::Node::Key{ "albumList2" } : Response::Node::Key{ "albumList" }) };
for (const ReleaseId releaseId : releases.results)
{
@@ -153,7 +153,7 @@ namespace API::Subsonic
throw UserNotAuthorizedError{};
Response response{ Response::createOkResponse(context.serverProtocolVersion) };
Response::Node& starredNode{ response.createNode(id3 ? "starred2" : "starred") };
Response::Node& starredNode{ response.createNode(id3 ? Response::Node::Key{ "starred2" } : Response::Node::Key{ "starred" }) };
Scrobbling::IScrobblingService& scrobbling{ *Service<Scrobbling::IScrobblingService>::get() };
@@ -54,7 +54,7 @@ namespace API::Subsonic
std::size_t count{ getParameterAs<std::size_t>(context.parameters, "count").value_or(20) };
Response response{ Response::createOkResponse(context.serverProtocolVersion) };
Response::Node& artistInfoNode{ response.createNode(id3 ? "artistInfo2" : "artistInfo") };
Response::Node& artistInfoNode{ response.createNode(id3 ? Response::Node::Key{ "artistInfo2" } : Response::Node::Key{ "artistInfo" }) };
{
auto transaction{ context.dbSession.createSharedTransaction() };
@@ -236,7 +236,7 @@ namespace API::Subsonic
throw UserNotAuthorizedError{};
Response response{ Response::createOkResponse(context.serverProtocolVersion) };
Response::Node& similarSongsNode{ response.createNode(id3 ? "similarSongs2" : "similarSongs") };
Response::Node& similarSongsNode{ response.createNode(id3 ? Response::Node::Key{ "similarSongs2" } : Response::Node::Key{ "similarSongs" }) };
for (const TrackId trackId : tracks)
{
const Track::pointer track{ Track::find(context.dbSession, trackId) };
@@ -28,8 +28,7 @@ namespace API::Subsonic::Scan
namespace
{
Response::Node
createStatusResponseNode()
Response::Node createStatusResponseNode()
{
Response::Node statusResponse;