aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaveTBlake <oak99sky@yahoo.co.uk>2015-12-08 18:54:24 +0000
committerDaveTBlake <oak99sky@yahoo.co.uk>2015-12-08 18:54:24 +0000
commitbb2272e5964c21526966c73463fc10491b66f41c (patch)
tree858a7806055e984d6a2e2dc9004a0c479168a8de
parent77d035a2188d26cbb5b303d7da52fea5aeb4545d (diff)
Override default setting for albumartistonly flag when already set in musicURL, so can be used by custom nodes.
Add query of album_artist and album_genre tables when "artists" playlist or custom node rule involves genre.
-rw-r--r--xbmc/music/MusicDatabase.cpp5
-rw-r--r--xbmc/playlists/SmartPlayList.cpp6
2 files changed, 9 insertions, 2 deletions
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp
index 1e29e06789..bfadd8459d 100644
--- a/xbmc/music/MusicDatabase.cpp
+++ b/xbmc/music/MusicDatabase.cpp
@@ -3373,7 +3373,10 @@ bool CMusicDatabase::GetArtistsNav(const std::string& strBaseDir, CFileItemList&
else if (idSong > 0)
musicUrl.AddOption("songid", idSong);
- musicUrl.AddOption("albumartistsonly", albumArtistsOnly);
+ // Override albumArtistsOnly parameter (usually externally set to SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS)
+ // when local option already present in muscic URL thus allowing it to be an option in custom nodes
+ if (!musicUrl.HasOption("albumartistsonly"))
+ musicUrl.AddOption("albumartistsonly", albumArtistsOnly);
bool result = GetArtistsByWhere(musicUrl.ToString(), filter, items, sortDescription, countOnly);
CLog::Log(LOGDEBUG,"Time to retrieve artists from dataset = %i", XbmcThreads::SystemClockMillis() - time);
diff --git a/xbmc/playlists/SmartPlayList.cpp b/xbmc/playlists/SmartPlayList.cpp
index b03f22b512..660b8a5ba7 100644
--- a/xbmc/playlists/SmartPlayList.cpp
+++ b/xbmc/playlists/SmartPlayList.cpp
@@ -754,7 +754,11 @@ std::string CSmartPlaylistRule::FormatWhereClause(const std::string &negate, con
table = "artistview";
if (m_field == FieldGenre)
- query = negate + " EXISTS (SELECT DISTINCT song_artist.idArtist FROM song_artist, song_genre, genre WHERE song_artist.idArtist = " + GetField(FieldId, strType) + " AND song_artist.idSong = song_genre.idSong AND song_genre.idGenre = genre.idGenre AND genre.strGenre" + parameter + ")";
+ {
+ query = negate + " (EXISTS (SELECT DISTINCT song_artist.idArtist FROM song_artist, song_genre, genre WHERE song_artist.idArtist = " + GetField(FieldId, strType) + " AND song_artist.idSong = song_genre.idSong AND song_genre.idGenre = genre.idGenre AND genre.strGenre" + parameter + ")";
+ query += " OR ";
+ query += "EXISTS (SELECT DISTINCT album_artist.idArtist FROM album_artist, album_genre, genre WHERE album_artist.idArtist = " + GetField(FieldId, strType) + " AND album_artist.idAlbum = album_genre.idAlbum AND album_genre.idGenre = genre.idGenre AND genre.strGenre" + parameter + "))";
+ }
}
else if (strType == "movies")
{