From aa281bbd224fc896cea1d4f2a98fbb0f729b04aa Mon Sep 17 00:00:00 2001 From: emeric Date: Sun, 6 Apr 2025 11:22:39 +0200 Subject: [PATCH] Fixed biography response for xml format, fixes #656 --- src/libs/subsonic/impl/endpoints/Browsing.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libs/subsonic/impl/endpoints/Browsing.cpp b/src/libs/subsonic/impl/endpoints/Browsing.cpp index 9f8ba747..b848f9c0 100644 --- a/src/libs/subsonic/impl/endpoints/Browsing.cpp +++ b/src/libs/subsonic/impl/endpoints/Browsing.cpp @@ -548,7 +548,17 @@ namespace lms::api::subsonic ArtistInfo::find(context.dbSession, id, Range{ .offset = 0, .size = 1 }, [&](const ArtistInfo::pointer& artistInfo) { if (!artistInfo->getBiography().empty()) - artistInfoNode.setAttribute("biography", artistInfo->getBiography()); + { + switch (context.responseFormat) + { + case ResponseFormat::json: + artistInfoNode.setAttribute("biography", artistInfo->getBiography()); + break; + case ResponseFormat::xml: + artistInfoNode.createChild("biography").setValue(artistInfo->getBiography()); + break; + } + } }); }