aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2015-12-09 11:21:20 +0100
committerMartijn Kaijser <martijn@xbmc.org>2015-12-09 11:21:20 +0100
commit051fc59eeec8e50a87d44b9f3294b8334679d4a0 (patch)
treecf2221fc9fefa042b745b8a3532b40d879b99128
parent3ba1d2547ad329b837ab9291c2805913129e33da (diff)
parentbb2272e5964c21526966c73463fc10491b66f41c (diff)
Merge pull request #8530 from DaveTBlake/Jarvis_CustomNodeAlbumArtistOnly
Fix Custom Music Node/Playlist Rule Based Queries
-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")
{