Subsonic API: made xml responses more compliant with legacy subsonic impl, fixes #559

This commit is contained in:
emeric
2024-11-29 21:46:22 +01:00
parent 13a0aab09c
commit e1bc607348
+4 -1
View File
@@ -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("<xmlattr>.xmlns", "http://subsonic.org/restapi");
}
for (const auto& [key, childArrayNodes] : node._childrenArrays)