Skip to content
Permalink
Browse files

musicdb: add strAlbumArtists to songview for fast retrieval

  • Loading branch information...
Montellese committed Nov 26, 2012
1 parent f8b9eea commit 7a5120222de1d6acf9b55bfe9b601f6b45700ceb
Showing with 7 additions and 3 deletions.
  1. +4 −1 xbmc/music/MusicDatabase.cpp
  2. +3 −2 xbmc/music/MusicDatabase.h
@@ -225,7 +225,8 @@ void CMusicDatabase::CreateViews()
" strMusicBrainzTRMID, iTimesPlayed, iStartOffset, iEndOffset, lastplayed,"
" rating, comment, song.idAlbum AS idAlbum, strAlbum, strPath,"
" iKaraNumber, iKaraDelay, strKaraEncoding,"
" album.bCompilation AS bCompilation "
" album.bCompilation AS bCompilation,"
" album.strArtists AS strAlbumArtists "
"FROM song"
" JOIN album ON"
" song.idAlbum=album.idAlbum"
@@ -912,6 +913,7 @@ CSong CMusicDatabase::GetSongFromDataset(bool bWithMusicDbPath/*=false*/)
song.strKaraokeLyrEncoding = m_pDS->fv(song_strKarEncoding).get_asString();
song.iKaraokeDelay = m_pDS->fv(song_iKarDelay).get_asInt();
song.bCompilation = m_pDS->fv(song_bCompilation).get_asInt() == 1;
song.albumArtist = StringUtils::Split(m_pDS->fv(song_strAlbumArtists).get_asString(), g_advancedSettings.m_musicItemSeparator);

// Get filename with full path
if (!bWithMusicDbPath)
@@ -964,6 +966,7 @@ void CMusicDatabase::GetFileItemFromDataset(const dbiplus::sql_record* const rec
URIUtils::AddFileToFolder(record->at(song_strPath).get_asString(), record->at(song_strFileName).get_asString(), strRealPath);
item->GetMusicInfoTag()->SetURL(strRealPath);
item->GetMusicInfoTag()->SetCompilation(record->at(song_bCompilation).get_asInt() == 1);
item->GetMusicInfoTag()->SetAlbumArtist(record->at(song_strAlbumArtists).get_asString());
item->GetMusicInfoTag()->SetLoaded(true);
// Get filename with full path
if (strMusicDBbasePath.IsEmpty())
@@ -281,7 +281,7 @@ class CMusicDatabase : public CDatabase
std::map<CStdString, CAlbum> m_albumCache;

virtual bool CreateTables();
virtual int GetMinVersion() const { return 30; };
virtual int GetMinVersion() const { return 31; };
const char *GetBaseDBName() const { return "MyMusic"; };

int AddSong(const CSong& song, bool bCheck = true, int idAlbum = -1);
@@ -353,7 +353,8 @@ class CMusicDatabase : public CDatabase
song_iKarNumber,
song_iKarDelay,
song_strKarEncoding,
song_bCompilation
song_bCompilation,
song_strAlbumArtists
} SongFields;

// Fields should be ordered as they

0 comments on commit 7a51202

Please sign in to comment.
You can’t perform that action at this time.