From 556d8ccb09f1b3591888d5bae6904eba8229d642 Mon Sep 17 00:00:00 2001 From: emeric Date: Thu, 18 Aug 2022 15:23:39 +0200 Subject: [PATCH] Add custom field 'type' in subsonic response to ease client hacks or custom behaviors. fixes #243 --- src/libs/subsonic/impl/SubsonicResponse.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/subsonic/impl/SubsonicResponse.cpp b/src/libs/subsonic/impl/SubsonicResponse.cpp index 38f6b631..da67c15a 100644 --- a/src/libs/subsonic/impl/SubsonicResponse.cpp +++ b/src/libs/subsonic/impl/SubsonicResponse.cpp @@ -117,6 +117,7 @@ Response::createOkResponse(ProtocolVersion protocolVersion) responseNode.setAttribute("status", "ok"); responseNode.setVersionAttribute(protocolVersion); + responseNode.setAttribute("type", "lms"); // non standard field to ease client hacks return response; } @@ -129,6 +130,7 @@ Response::createFailedResponse(ProtocolVersion protocolVersion, const Error& err responseNode.setAttribute("status", "failed"); responseNode.setVersionAttribute(protocolVersion); + responseNode.setAttribute("type", "lms"); // non standard field to ease client hacks Node& errorNode {responseNode.createChild("error")}; errorNode.setAttribute("code", std::to_string(static_cast(error.getCode())));