aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjenkins4kodi <jenkins4kodi@users.noreply.github.com>2015-12-22 12:42:43 +0100
committerjenkins4kodi <jenkins4kodi@users.noreply.github.com>2015-12-22 12:42:43 +0100
commit6dea8ab4fd17f2ed47af6c618fec1146b6d1afaa (patch)
treef9c2b870b00f8fb45a178286205df7f1f919f6e7
parentec8bc11ed6f6d6f5f387a5aefdc2c4948a505952 (diff)
parent448fbdf24e950ac0b05522185310f00efe85e4d4 (diff)
Merge pull request #8637 from DaveTBlake/Jarvis_JSONPLaylistArtist
-rw-r--r--xbmc/interfaces/json-rpc/schema/version.txt2
-rw-r--r--xbmc/music/tags/MusicInfoTag.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt
index b02bea9d2b..4b3b8be193 100644
--- a/xbmc/interfaces/json-rpc/schema/version.txt
+++ b/xbmc/interfaces/json-rpc/schema/version.txt
@@ -1 +1 @@
-6.32.2
+6.32.3
diff --git a/xbmc/music/tags/MusicInfoTag.cpp b/xbmc/music/tags/MusicInfoTag.cpp
index edb102ade4..32e68c8e09 100644
--- a/xbmc/music/tags/MusicInfoTag.cpp
+++ b/xbmc/music/tags/MusicInfoTag.cpp
@@ -697,6 +697,16 @@ void CMusicInfoTag::Serialize(CVariant& value) const
value["artist"] = m_artist[0];
else
value["artist"] = m_artist;
+
+ // There are situations where the individual artist(s) are not queried from the song_artist and artist tables e.g. playlist,
+ // only artist description from song table. Since processing of the ARTISTS tag was added the individual artists may not always
+ // be accurately derrived by simply splitting the artist desc. Hence m_artist is only populated when the individual artists are
+ // queried, whereas GetArtistString() will always return the artist description.
+ // To avoid empty artist array in JSON, when m_artist is empty then an attempt is made to split the artist desc into artists.
+ // A longer term soltion would be to ensure that when individual artists are to be returned then the song_artist and artist tables
+ // are queried.
+ if (m_artist.empty())
+ value["artist"] = StringUtils::Split(GetArtistString(), g_advancedSettings.m_musicItemSeparator);
value["displayartist"] = GetArtistString();
value["displayalbumartist"] = GetAlbumArtistString();
value["album"] = m_strAlbum;