From e1bc60734897a651af4ef350c8c566d380e55407 Mon Sep 17 00:00:00 2001 From: emeric Date: Fri, 29 Nov 2024 21:46:22 +0100 Subject: [PATCH] Subsonic API: made xml responses more compliant with legacy subsonic impl, fixes #559 --- src/libs/subsonic/impl/SubsonicResponse.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/subsonic/impl/SubsonicResponse.cpp b/src/libs/subsonic/impl/SubsonicResponse.cpp index 32060cfb..4110cc4e 100644 --- a/src/libs/subsonic/impl/SubsonicResponse.cpp +++ b/src/libs/subsonic/impl/SubsonicResponse.cpp @@ -202,7 +202,10 @@ namespace lms::api::subsonic { for (const auto& [key, childNode] : node._children) { - res.add_child(std::string{ key.str() }, nodeToPropertyTree(childNode)); + boost::property_tree::ptree& tree{ res.add_child(std::string{ key.str() }, nodeToPropertyTree(childNode)) }; + // Hardcoded attribute to simplify createOkResponse calls + if (key == "subsonic-response") + tree.put(".xmlns", "http://subsonic.org/restapi"); } for (const auto& [key, childArrayNodes] : node._childrenArrays)