From fbdc15bd5c8aa3883535f22d73d70199dd50a7c6 Mon Sep 17 00:00:00 2001 From: emeric Date: Sun, 15 Oct 2023 18:44:41 +0200 Subject: [PATCH] Subsonic API: put artist display name instead of a comma separated list --- src/libs/subsonic/impl/responses/Album.cpp | 5 ++++- src/libs/subsonic/impl/responses/Song.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libs/subsonic/impl/responses/Album.cpp b/src/libs/subsonic/impl/responses/Album.cpp index 5e93c6ff..408a3fa9 100644 --- a/src/libs/subsonic/impl/responses/Album.cpp +++ b/src/libs/subsonic/impl/responses/Album.cpp @@ -107,7 +107,10 @@ namespace API::Subsonic } else if (!artists.empty()) { - albumNode.setAttribute("artist", Utils::joinArtistNames(artists)); + if (!release->getArtistDisplayName().empty()) + albumNode.setAttribute("artist", release->getArtistDisplayName()); + else + albumNode.setAttribute("artist", Utils::joinArtistNames(artists)); if (artists.size() == 1) { diff --git a/src/libs/subsonic/impl/responses/Song.cpp b/src/libs/subsonic/impl/responses/Song.cpp index 52705075..d3594260 100644 --- a/src/libs/subsonic/impl/responses/Song.cpp +++ b/src/libs/subsonic/impl/responses/Song.cpp @@ -127,7 +127,10 @@ namespace API::Subsonic const std::vector& artists{ track->getArtists({TrackArtistLinkType::Artist}) }; if (!artists.empty()) { - trackResponse.setAttribute("artist", Utils::joinArtistNames(artists)); + if (!track->getArtistDisplayName().empty()) + trackResponse.setAttribute("artist", track->getArtistDisplayName()); + else + trackResponse.setAttribute("artist", Utils::joinArtistNames(artists)); if (artists.size() == 1) trackResponse.setAttribute("artistId", idToString(artists.front()->getId()));