[musicdb] drop use of GROUP_CONCAT in albumview and instead use album.strArtists
authorJonathan Marshall <jmarshall@xbmc.org>
Sat, 30 Nov 2013 08:52:19 +0000 (21:52 +1300)
committerJonathan Marshall <jmarshall@xbmc.org>
Tue, 24 Dec 2013 00:48:59 +0000 (13:48 +1300)
xbmc/music/MusicDatabase.cpp

index 65cb096..a87a656 100644 (file)
@@ -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");