Skip to content
Browse files

fix partymode for smartplaylists with no filters

  • Loading branch information...
1 parent c7cf16c commit 9f2a5481b1f788f7d9abd5b67554a682a7f60602 @Montellese Montellese committed May 23, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 xbmc/PartyModeManager.cpp
View
12 xbmc/PartyModeManager.cpp
@@ -113,7 +113,11 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS
{
set<CStdString> playlists;
if ( playlistLoaded )
- m_strCurrentFilterMusic = "WHERE " + playlist.GetWhereClause(db, playlists);
+ {
+ m_strCurrentFilterMusic = playlist.GetWhereClause(db, playlists);
+ if (!m_strCurrentFilterMusic.empty())
+ m_strCurrentFilterMusic = "WHERE " + m_strCurrentFilterMusic;
+ }
CLog::Log(LOGINFO, "PARTY MODE MANAGER: Registering filter:[%s]", m_strCurrentFilterMusic.c_str());
m_iMatchingSongs = (int)db.GetSongIDs(m_strCurrentFilterMusic, songIDs);
@@ -142,7 +146,11 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS
{
set<CStdString> playlists;
if ( playlistLoaded )
- m_strCurrentFilterVideo = "WHERE " + playlist.GetWhereClause(db, playlists);
+ {
+ m_strCurrentFilterVideo = playlist.GetWhereClause(db, playlists);
+ if (!m_strCurrentFilterVideo.empty())
+ m_strCurrentFilterVideo = "WHERE " + m_strCurrentFilterVideo;
+ }
CLog::Log(LOGINFO, "PARTY MODE MANAGER: Registering filter:[%s]", m_strCurrentFilterVideo.c_str());
m_iMatchingSongs += (int)db.GetMusicVideoIDs(m_strCurrentFilterVideo, songIDs2);

0 comments on commit 9f2a548

Please sign in to comment.
Something went wrong with that request. Please try again.