diff --git a/src/libs/subsonic/impl/SubsonicResponse.cpp b/src/libs/subsonic/impl/SubsonicResponse.cpp index 51101396..c210c117 100644 --- a/src/libs/subsonic/impl/SubsonicResponse.cpp +++ b/src/libs/subsonic/impl/SubsonicResponse.cpp @@ -209,23 +209,29 @@ namespace API::Subsonic res.put_value(std::get(value)); else if (std::holds_alternative(value)) res.put_value(std::get(value)); + else if (std::holds_alternative(value)) + res.put_value(std::get(value)); else if (std::holds_alternative(value)) res.put_value(std::get(value)); } else { - for (auto itChildNode : node._children) + for (const auto& [key, childNodes] : node._children) { - for (const Response::Node& childNode : itChildNode.second) - res.add_child(itChildNode.first, nodeToPropertyTree(childNode)); + for (const Response::Node& childNode : childNodes) + res.add_child(key, nodeToPropertyTree(childNode)); } - for (auto itChildArrayNode : node._childrenArrays) + for (const auto& [key, childArrayNodes] : node._childrenArrays) { - const std::vector& childArrayNodes{ itChildArrayNode.second }; - for (const Response::Node& childNode : childArrayNodes) - res.add_child(itChildArrayNode.first, nodeToPropertyTree(childNode)); + res.add_child(key, nodeToPropertyTree(childNode)); + } + + for (const auto& [key, childArrayValues] : node._childrenValues) + { + for (const std::string& value : childArrayValues) + res.add_child(key, boost::property_tree::ptree{ value }); } }