diff options
author | Jonathan Marshall <jmarshall@never.you.mind> | 2012-04-12 20:50:49 +1200 |
---|---|---|
committer | Jonathan Marshall <jmarshall@never.you.mind> | 2012-04-12 20:50:49 +1200 |
commit | bbb815b072a16202befe5dc97784af76a8698c1c (patch) | |
tree | 53d0e144455afbf7a4e9ffb826ea4f3239b22f6d | |
parent | 33f326da6160cba83f241751b5b54e421290d58b (diff) |
one more item separator weirdness in the musicdb
-rw-r--r-- | xbmc/music/MusicDatabase.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index aa1e07aaaf..8691a4f66e 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -764,14 +764,24 @@ CSong CMusicDatabase::GetSongFromDataset(bool bWithMusicDbPath/*=false*/) void CMusicDatabase::GetFileItemFromDataset(CFileItem* item, const CStdString& strMusicDBbasePath) { // get the full artist string - CStdString strArtist=m_pDS->fv(song_strArtist).get_asString(); - strArtist += m_pDS->fv(song_strExtraArtists).get_asString(); - item->GetMusicInfoTag()->SetArtist(strArtist); + vector<string> artist; + artist.push_back(m_pDS->fv(song_strArtist).get_asString()); + if (!m_pDS->fv(song_strExtraArtists).get_asString().empty()) + { + vector<string> extraArtists = StringUtils::Split(m_pDS->fv(song_strExtraArtists).get_asString(), g_advancedSettings.m_musicItemSeparator); + artist.insert(artist.end(), extraArtists.begin(), extraArtists.end()); + } + item->GetMusicInfoTag()->SetArtist(artist); item->GetMusicInfoTag()->SetArtistId(m_pDS->fv(song_idArtist).get_asInt()); // and the full genre string - CStdString strGenre = m_pDS->fv(song_strGenre).get_asString(); - strGenre += m_pDS->fv(song_strExtraGenres).get_asString(); - item->GetMusicInfoTag()->SetGenre(strGenre); + vector<string> genre; + genre.push_back(m_pDS->fv(song_strGenre).get_asString()); + if (!m_pDS->fv(song_strExtraGenres).get_asString().empty()) + { + vector<string> extraGenres = StringUtils::Split(m_pDS->fv(song_strExtraGenres).get_asString(), g_advancedSettings.m_musicItemSeparator); + genre.insert(genre.end(), extraGenres.begin(), extraGenres.end()); + } + item->GetMusicInfoTag()->SetGenre(genre); // and the rest... item->GetMusicInfoTag()->SetAlbum(m_pDS->fv(song_strAlbum).get_asString()); item->GetMusicInfoTag()->SetAlbumId(m_pDS->fv(song_idAlbum).get_asInt()); |