diff options
author | Jonathan Marshall <jmarshall@xbmc.org> | 2013-12-01 20:49:25 +1300 |
---|---|---|
committer | Jonathan Marshall <jmarshall@xbmc.org> | 2013-12-24 13:48:53 +1300 |
commit | c77042d75b79235bde56e8ca35acfc049b8cd710 (patch) | |
tree | e8ba9272d2b2b862b7d86792a8da97edd39ea1df | |
parent | fd93eedda81c58910031ef49750cf7a6c6db9478 (diff) |
[musicdb] adds infoSongs to CAlbum, so that songs can hold the users songs, and infoSongs scraped songs
-rw-r--r-- | xbmc/music/Album.cpp | 6 | ||||
-rw-r--r-- | xbmc/music/Album.h | 4 | ||||
-rw-r--r-- | xbmc/music/MusicDatabase.cpp | 4 | ||||
-rw-r--r-- | xbmc/music/dialogs/GUIDialogMusicInfo.cpp | 4 | ||||
-rw-r--r-- | xbmc/music/infoscanner/MusicAlbumInfo.h | 2 | ||||
-rw-r--r-- | xbmc/music/infoscanner/MusicInfoScanner.cpp | 8 | ||||
-rw-r--r-- | xbmc/music/windows/GUIWindowMusicBase.cpp | 2 |
7 files changed, 16 insertions, 14 deletions
diff --git a/xbmc/music/Album.cpp b/xbmc/music/Album.cpp index ea4f5d0f5c..8a0438db18 100644 --- a/xbmc/music/Album.cpp +++ b/xbmc/music/Album.cpp @@ -173,7 +173,7 @@ bool CAlbum::Load(const TiXmlElement *album, bool append, bool prioritise) const TiXmlElement* node = album->FirstChildElement("track"); if (node) - songs.clear(); // this means that the tracks can't be spread over separate pages + infoSongs.clear(); // this means that the tracks can't be spread over separate pages // but this is probably a reasonable limitation bool bIncrement = false; while (node) @@ -215,7 +215,7 @@ bool CAlbum::Load(const TiXmlElement *album, bool append, bool prioritise) if (bIncrement) song.iTrack = song.iTrack + 1; - songs.push_back(song); + infoSongs.push_back(song); } node = node->NextSiblingElement("track"); } @@ -274,7 +274,7 @@ bool CAlbum::Save(TiXmlNode *node, const CStdString &tag, const CStdString& strP XMLUtils::SetString(albumArtistCreditsNode, "featuring", artistCredit->GetArtist()); } - for( VECSONGS::const_iterator song = songs.begin(); song != songs.end(); ++song) + for( VECSONGS::const_iterator song = infoSongs.begin(); song != infoSongs.end(); ++song) { // add a <song> tag TiXmlElement cast("track"); diff --git a/xbmc/music/Album.h b/xbmc/music/Album.h index 2cd331ea67..ac071b84d5 100644 --- a/xbmc/music/Album.h +++ b/xbmc/music/Album.h @@ -62,6 +62,7 @@ public: bCompilation = false; iTimesPlayed = 0; songs.clear(); + infoSongs.clear(); } CStdString GetArtistString() const; @@ -97,7 +98,8 @@ public: int iYear; bool bCompilation; int iTimesPlayed; - VECSONGS songs; + VECSONGS songs; ///< Local songs + VECSONGS infoSongs; ///< Scraped songs }; typedef std::vector<CAlbum> VECALBUMS; diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index 716c59f1a8..df301dbefb 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -4659,7 +4659,7 @@ void CMusicDatabase::ExportToXML(const CStdString &xmlFile, bool singleFiles, bo for (vector<int>::iterator albumId = albumIds.begin(); albumId != albumIds.end(); ++albumId) { CAlbum album; - GetAlbumInfo(*albumId, album, &album.songs); + GetAlbumInfo(*albumId, album, &album.infoSongs); CStdString strPath; GetAlbumPath(*albumId, strPath); album.Save(pMain, "album", strPath); @@ -4862,7 +4862,7 @@ void CMusicDatabase::ImportFromXML(const CStdString &xmlFile) strTitle = album.strAlbum; int idAlbum = GetAlbumByName(album.strAlbum,album.artist); if (idAlbum > -1) - SetAlbumInfo(idAlbum,album,album.songs,false); + SetAlbumInfo(idAlbum,album,album.infoSongs,false); current++; } diff --git a/xbmc/music/dialogs/GUIDialogMusicInfo.cpp b/xbmc/music/dialogs/GUIDialogMusicInfo.cpp index 7c26b5d62a..7d0dbc98bc 100644 --- a/xbmc/music/dialogs/GUIDialogMusicInfo.cpp +++ b/xbmc/music/dialogs/GUIDialogMusicInfo.cpp @@ -150,7 +150,7 @@ bool CGUIDialogMusicInfo::OnAction(const CAction &action) void CGUIDialogMusicInfo::SetAlbum(const CAlbum& album, const CStdString &path) { m_album = album; - SetSongs(m_album.songs); + SetSongs(m_album.infoSongs); *m_albumItem = CFileItem(path, true); m_albumItem->GetMusicInfoTag()->SetAlbum(m_album.strAlbum); m_albumItem->GetMusicInfoTag()->SetAlbumArtist(StringUtils::Join(m_album.artist, g_advancedSettings.m_musicItemSeparator)); @@ -558,7 +558,7 @@ void CGUIDialogMusicInfo::OnSearch(const CFileItem* pItem) pItem->GetMusicInfoTag()->GetDatabaseId() > 0) { CAlbum album; - if (database.GetAlbumInfo(pItem->GetMusicInfoTag()->GetDatabaseId(), album, &album.songs)) + if (database.GetAlbumInfo(pItem->GetMusicInfoTag()->GetDatabaseId(), album, &album.infoSongs)) { CStdString strPath; database.GetAlbumPath(pItem->GetMusicInfoTag()->GetDatabaseId(), strPath); diff --git a/xbmc/music/infoscanner/MusicAlbumInfo.h b/xbmc/music/infoscanner/MusicAlbumInfo.h index 947927fd27..e764a233c2 100644 --- a/xbmc/music/infoscanner/MusicAlbumInfo.h +++ b/xbmc/music/infoscanner/MusicAlbumInfo.h @@ -44,7 +44,7 @@ public: const CAlbum &GetAlbum() const { return m_album; } CAlbum& GetAlbum() { return m_album; } void SetAlbum(CAlbum& album); - const VECSONGS &GetSongs() const { return m_album.songs; } + const VECSONGS &GetSongs() const { return m_album.infoSongs; } const CStdString& GetTitle2() const { return m_strTitle2; } void SetTitle(const CStdString& strTitle) { m_album.strAlbum = strTitle; } const CScraperUrl& GetAlbumURL() const { return m_albumURL; } diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp index 027ae45b88..ae060b2c89 100644 --- a/xbmc/music/infoscanner/MusicInfoScanner.cpp +++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp @@ -176,7 +176,7 @@ void CMusicInfoScanner::Process() continue; CAlbum album; - m_musicDatabase.GetAlbumInfo(params.GetAlbumId(), album, &album.songs); + m_musicDatabase.GetAlbumInfo(params.GetAlbumId(), album, &album.infoSongs); if (m_handle) { float percentage = (float) std::distance(it, m_pathsToScan.end()) / m_pathsToScan.size(); @@ -729,7 +729,7 @@ int CMusicInfoScanner::RetrieveMusicInfo(const CStdString& strDirectory, CFileIt downloadedAlbum.bCompilation); m_musicDatabase.SetAlbumInfo(downloadedAlbum.idAlbum, downloadedAlbum, - downloadedAlbum.songs); + downloadedAlbum.infoSongs); m_musicDatabase.SetArtForItem(downloadedAlbum.idAlbum, "album", album->art); GetAlbumArtwork(downloadedAlbum.idAlbum, downloadedAlbum); @@ -1014,7 +1014,7 @@ INFO_RET CMusicInfoScanner::UpdateDatabaseAlbumInfo(const CStdString& strPath, C return INFO_ERROR; CAlbum album; - m_musicDatabase.GetAlbumInfo(params.GetAlbumId(), album, &album.songs); + m_musicDatabase.GetAlbumInfo(params.GetAlbumId(), album, &album.infoSongs); // find album info ADDON::ScraperPtr scraper; @@ -1046,7 +1046,7 @@ loop: else if (albumDownloadStatus == INFO_ADDED) { m_musicDatabase.Open(); - m_musicDatabase.SetAlbumInfo(params.GetAlbumId(), albumInfo.GetAlbum(), albumInfo.GetAlbum().songs); + m_musicDatabase.SetAlbumInfo(params.GetAlbumId(), albumInfo.GetAlbum(), albumInfo.GetAlbum().infoSongs); GetAlbumArtwork(params.GetAlbumId(), albumInfo.GetAlbum()); albumInfo.SetLoaded(true); m_musicDatabase.Close(); diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp index 20b783cca0..40ca26dbb3 100644 --- a/xbmc/music/windows/GUIWindowMusicBase.cpp +++ b/xbmc/music/windows/GUIWindowMusicBase.cpp @@ -433,7 +433,7 @@ bool CGUIWindowMusicBase::ShowAlbumInfo(const CFileItem *pItem, bool bShowInfo / while (1) { if (!m_musicdatabase.HasAlbumInfo(params.GetAlbumId()) || - !m_musicdatabase.GetAlbumInfo(params.GetAlbumId(), albumInfo.GetAlbum(), &albumInfo.GetAlbum().songs)) + !m_musicdatabase.GetAlbumInfo(params.GetAlbumId(), albumInfo.GetAlbum(), &albumInfo.GetAlbum().infoSongs)) { if (!CProfilesManager::Get().GetCurrentProfile().canWriteDatabases() && !g_passwordManager.bMasterUser) { |