aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Marshall <jmarshall@xbmc.org>2013-11-30 21:52:19 +1300
committerJonathan Marshall <jmarshall@xbmc.org>2013-12-24 13:48:59 +1300
commite5f8755c0cdacf3f8e78c7a0326bbefa74d61d5f (patch)
tree9a27504bd989d9ef3fc5e0f53aa985497cc179f2
parente2cab51795da23642fe3be5f456574800212f56d (diff)
[musicdb] drop use of GROUP_CONCAT in albumview and instead use album.strArtists
-rw-r--r--xbmc/music/MusicDatabase.cpp66
1 files changed, 18 insertions, 48 deletions
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp
index 65cb096063..a87a656ed6 100644
--- a/xbmc/music/MusicDatabase.cpp
+++ b/xbmc/music/MusicDatabase.cpp
@@ -306,54 +306,24 @@ void CMusicDatabase::CreateViews()
CLog::Log(LOGINFO, "create album view");
m_pDS->exec("DROP VIEW IF EXISTS albumview");
- if (m_sqlite)
- {
- m_pDS->exec("CREATE VIEW albumview AS SELECT "
- " album.idAlbum AS idAlbum, "
- " strAlbum, "
- " strMusicBrainzAlbumID, "
- " GROUP_CONCAT(strArtist || strJoinPhrase, '') as strArtists, "
- " album.strGenres AS strGenres, "
- " album.iYear AS iYear, "
- " album.strMoods AS strMoods, "
- " album.strStyles AS strStyles, "
- " strThemes, "
- " strReview, "
- " strLabel, "
- " strType, "
- " album.strImage as strImage, "
- " iRating, "
- " bCompilation, "
- " (SELECT MIN(iTimesPlayed) AS iTimesPlayed FROM song WHERE song.idAlbum = album.idAlbum)"
- " FROM album "
- " LEFT OUTER JOIN album_artist ON "
- " album.idAlbum = album_artist.idAlbum "
- " GROUP BY album.idAlbum");
- }
- else
- {
- m_pDS->exec("CREATE VIEW albumview AS SELECT "
- " album.idAlbum AS idAlbum, "
- " strAlbum, "
- " strMusicBrainzAlbumID, "
- " GROUP_CONCAT(strArtist, strJoinPhrase ORDER BY iOrder SEPARATOR '') as strArtists, "
- " album.strGenres AS strGenres, "
- " album.iYear AS iYear, "
- " strMoods, "
- " strStyles, "
- " strThemes, "
- " strReview, "
- " strLabel, "
- " strType, "
- " strImage, "
- " iRating, "
- " bCompilation, "
- " (SELECT MIN(iTimesPlayed) AS iTimesPlayed FROM song WHERE song.idAlbum = album.idAlbum)"
- " FROM album "
- " LEFT OUTER JOIN album_artist ON "
- " album.idAlbum = album_artist.idAlbum "
- " GROUP BY album.idAlbum");
- }
+ m_pDS->exec("CREATE VIEW albumview AS SELECT "
+ " album.idAlbum AS idAlbum, "
+ " strAlbum, "
+ " strMusicBrainzAlbumID, "
+ " album.strArtists AS strArtists, "
+ " album.strGenres AS strGenres, "
+ " album.iYear AS iYear, "
+ " album.strMoods AS strMoods, "
+ " album.strStyles AS strStyles, "
+ " strThemes, "
+ " strReview, "
+ " strLabel, "
+ " strType, "
+ " album.strImage as strImage, "
+ " iRating, "
+ " bCompilation, "
+ " (SELECT MIN(iTimesPlayed) AS iTimesPlayed FROM song WHERE song.idAlbum = album.idAlbum)"
+ " FROM album ");
CLog::Log(LOGINFO, "create artist view");
m_pDS->exec("DROP VIEW IF EXISTS artistview");