Subsonic API: put artist display name instead of a comma separated list

This commit is contained in:
emeric
2023-10-15 18:44:41 +02:00
parent 8780bbdffa
commit fbdc15bd5c
2 changed files with 8 additions and 2 deletions
@@ -107,6 +107,9 @@ namespace API::Subsonic
} }
else if (!artists.empty()) else if (!artists.empty())
{ {
if (!release->getArtistDisplayName().empty())
albumNode.setAttribute("artist", release->getArtistDisplayName());
else
albumNode.setAttribute("artist", Utils::joinArtistNames(artists)); albumNode.setAttribute("artist", Utils::joinArtistNames(artists));
if (artists.size() == 1) if (artists.size() == 1)
@@ -127,6 +127,9 @@ namespace API::Subsonic
const std::vector<Artist::pointer>& artists{ track->getArtists({TrackArtistLinkType::Artist}) }; const std::vector<Artist::pointer>& artists{ track->getArtists({TrackArtistLinkType::Artist}) };
if (!artists.empty()) if (!artists.empty())
{ {
if (!track->getArtistDisplayName().empty())
trackResponse.setAttribute("artist", track->getArtistDisplayName());
else
trackResponse.setAttribute("artist", Utils::joinArtistNames(artists)); trackResponse.setAttribute("artist", Utils::joinArtistNames(artists));
if (artists.size() == 1) if (artists.size() == 1)