aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Marshall <jmarshall@xbmc.org>2013-11-30 18:59:55 +1300
committerJonathan Marshall <jmarshall@xbmc.org>2013-12-24 13:48:50 +1300
commit15ccc41a6e7fc4d18057aae8696d1837f0f4b984 (patch)
tree823435df048f7c9c22f6e88514a7ab25987a8d4a
parent0c6e32543b8fe31a40f2a9baaee55b66df6828bd (diff)
[musicdb] cosmetic: have (Update|Add)Song should take the constructed artist string rather than the vector of artists
-rw-r--r--xbmc/music/MusicDatabase.cpp12
-rw-r--r--xbmc/music/MusicDatabase.h8
-rw-r--r--xbmc/music/infoscanner/MusicInfoScanner.cpp2
3 files changed, 11 insertions, 11 deletions
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp
index 3e2f6f4aca..cb9e9145df 100644
--- a/xbmc/music/MusicDatabase.cpp
+++ b/xbmc/music/MusicDatabase.cpp
@@ -347,7 +347,7 @@ void CMusicDatabase::CreateViews()
int CMusicDatabase::AddSong(const int idAlbum,
const CStdString& strTitle, const CStdString& strMusicBrainzTrackID,
const CStdString& strPathAndFileName, const CStdString& strComment, const CStdString& strThumb,
- const std::vector<std::string>& artists, const std::vector<std::string>& genres,
+ const std::string &artistString, const std::vector<std::string>& genres,
int iTrack, int iDuration, int iYear,
const int iTimesPlayed, int iStartOffset, int iEndOffset,
const CDateTime& dtLastPlayed, char rating, int iKaraokeNumber)
@@ -392,7 +392,7 @@ int CMusicDatabase::AddSong(const int idAlbum,
strSQL=PrepareSQL("INSERT INTO song (idSong,idAlbum,idPath,strArtists,strGenres,strTitle,iTrack,iDuration,iYear,dwFileNameCRC,strFileName,strMusicBrainzTrackID,iTimesPlayed,iStartOffset,iEndOffset,lastplayed,rating,comment) values (NULL, %i, %i, '%s', '%s', '%s', %i, %i, %i, '%ul', '%s'",
idAlbum,
idPath,
- StringUtils::Join(artists, g_advancedSettings.m_musicItemSeparator).c_str(),
+ artistString.c_str(),
StringUtils::Join(genres, g_advancedSettings.m_musicItemSeparator).c_str(),
strTitle.c_str(),
iTrack, iDuration, iYear,
@@ -416,7 +416,7 @@ int CMusicDatabase::AddSong(const int idAlbum,
{
idSong = m_pDS->fv("idSong").get_asInt();
m_pDS->close();
- UpdateSong(idSong, strTitle, strMusicBrainzTrackID, strPathAndFileName, strComment, strThumb, artists, genres, iTrack, iDuration, iYear, iTimesPlayed, iStartOffset, iEndOffset, dtLastPlayed, rating, iKaraokeNumber);
+ UpdateSong(idSong, strTitle, strMusicBrainzTrackID, strPathAndFileName, strComment, strThumb, artistString, genres, iTrack, iDuration, iYear, iTimesPlayed, iStartOffset, iEndOffset, dtLastPlayed, rating, iKaraokeNumber);
}
if (!strThumb.empty())
@@ -492,7 +492,7 @@ int CMusicDatabase::UpdateSong(int idSong, const CSong &song)
song.strFileName,
song.strComment,
song.strThumb,
- song.artist,
+ StringUtils::Join(song.artist, g_advancedSettings.m_musicItemSeparator), // NOTE: Don't call this function internally!!!
song.genre,
song.iTrack,
song.iDuration,
@@ -508,7 +508,7 @@ int CMusicDatabase::UpdateSong(int idSong, const CSong &song)
int CMusicDatabase::UpdateSong(int idSong,
const CStdString& strTitle, const CStdString& strMusicBrainzTrackID,
const CStdString& strPathAndFileName, const CStdString& strComment, const CStdString& strThumb,
- const std::vector<std::string>& artists, const std::vector<std::string>& genres,
+ const std::string& artistString, const std::vector<std::string>& genres,
int iTrack, int iDuration, int iYear,
int iTimesPlayed, int iStartOffset, int iEndOffset,
const CDateTime& dtLastPlayed, char rating, int iKaraokeNumber)
@@ -524,7 +524,7 @@ int CMusicDatabase::UpdateSong(int idSong,
strSQL = PrepareSQL("UPDATE song SET idPath = %i, strArtists = '%s', strGenres = '%s', strTitle = '%s', iTrack = %i, iDuration = %i, iYear = %i, dwFileNameCRC = '%ul', strFileName = '%s'",
idPath,
- StringUtils::Join(artists, g_advancedSettings.m_musicItemSeparator).c_str(),
+ artistString.c_str(),
StringUtils::Join(genres, g_advancedSettings.m_musicItemSeparator).c_str(),
strTitle.c_str(),
iTrack, iDuration, iYear,
diff --git a/xbmc/music/MusicDatabase.h b/xbmc/music/MusicDatabase.h
index 3cb649a561..f97e40788b 100644
--- a/xbmc/music/MusicDatabase.h
+++ b/xbmc/music/MusicDatabase.h
@@ -111,7 +111,7 @@ public:
\param strPathAndFileName [in] the path and filename to the song
\param strComment [in] the ids of the added songs
\param strThumb [in] the ids of the added songs
- \param artists [in] a vector of artist names (will only be used for the cache names in the album views)
+ \param artistString [in] the assembled artist string, denormalized from CONCAT(strArtist||strJoinPhrase)
\param genres [in] a vector of genres to which this song belongs
\param iTrack [in] the track number and disc number of the song
\param iDuration [in] the duration of the song
@@ -130,7 +130,7 @@ public:
const CStdString& strPathAndFileName,
const CStdString& strComment,
const CStdString& strThumb,
- const std::vector<std::string>& artists, const std::vector<std::string>& genres,
+ const std::string &artistString, const std::vector<std::string>& genres,
int iTrack, int iDuration, int iYear,
const int iTimesPlayed, int iStartOffset, int iEndOffset,
const CDateTime& dtLastPlayed,
@@ -157,7 +157,7 @@ public:
\param strPathAndFileName [in] the path and filename to the song
\param strComment [in] the ids of the added songs
\param strThumb [in] the ids of the added songs
- \param artists [in] a vector of artist names (will only be used for the cache names in the album views)
+ \param artistString [in] the full artist string, denormalized from CONCAT(song_artist.strArtist || song_artist.strJoinPhrase)
\param genres [in] a vector of genres to which this song belongs
\param iTrack [in] the track number and disc number of the song
\param iDuration [in] the duration of the song
@@ -174,7 +174,7 @@ public:
const CStdString& strTitle, const CStdString& strMusicBrainzTrackID,
const CStdString& strPathAndFileName, const CStdString& strComment,
const CStdString& strThumb,
- const std::vector<std::string>& artists, const std::vector<std::string>& genres,
+ const std::string& artistString, const std::vector<std::string>& genres,
int iTrack, int iDuration, int iYear,
int iTimesPlayed, int iStartOffset, int iEndOffset,
const CDateTime& dtLastPlayed,
diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp
index 9f20ed1a7d..456b742e1a 100644
--- a/xbmc/music/infoscanner/MusicInfoScanner.cpp
+++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp
@@ -823,7 +823,7 @@ int CMusicInfoScanner::RetrieveMusicInfo(const CStdString& strDirectory, CFileIt
song->strTitle, song->strMusicBrainzTrackID,
song->strFileName, song->strComment,
song->strThumb,
- song->artist, song->genre,
+ StringUtils::Join(song->artist, g_advancedSettings.m_musicItemSeparator), song->genre,
song->iTrack, song->iDuration, song->iYear,
song->iTimesPlayed, song->iStartOffset,
song->iEndOffset,