Permalink
Browse files

fix "Play in party mode" for smartplaylists

  • Loading branch information...
1 parent 315d4fe commit 42c6c6fe3e9e78a59611a88bb29f493115c37f66 @Montellese Montellese committed May 20, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 xbmc/PartyModeManager.cpp
@@ -113,7 +113,7 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS
{
set<CStdString> playlists;
if ( playlistLoaded )
- m_strCurrentFilterMusic = playlist.GetWhereClause(db, playlists);
+ m_strCurrentFilterMusic = "WHERE " + playlist.GetWhereClause(db, playlists);
CLog::Log(LOGINFO, "PARTY MODE MANAGER: Registering filter:[%s]", m_strCurrentFilterMusic.c_str());
m_iMatchingSongs = (int)db.GetSongIDs(m_strCurrentFilterMusic, songIDs);
@@ -142,7 +142,7 @@ bool CPartyModeManager::Enable(PartyModeContext context /*= PARTYMODECONTEXT_MUS
{
set<CStdString> playlists;
if ( playlistLoaded )
- m_strCurrentFilterVideo = playlist.GetWhereClause(db, playlists);
+ m_strCurrentFilterVideo = "WHERE " + playlist.GetWhereClause(db, playlists);
@jmarshallnz
jmarshallnz May 20, 2012 Member

This one looks doubly good (i.e. bad).

@Montellese
Montellese May 20, 2012 Member

Not sure I understand. CVideoDatabase::GetMusicVideoIDs does not (yet) use the CVideoDatabase::Filter logic so it still needs the "WHERE" added in the clause passed to the method. A better fix would be to pass a CVideoDatabase::Filter object to GetMusicVideoIDs but I didn't have that much time ;-)

@jmarshallnz
jmarshallnz May 20, 2012 Member

So it does - I assumed :p

CLog::Log(LOGINFO, "PARTY MODE MANAGER: Registering filter:[%s]", m_strCurrentFilterVideo.c_str());
m_iMatchingSongs += (int)db.GetMusicVideoIDs(m_strCurrentFilterVideo, songIDs2);

3 comments on commit 42c6c6f

@Giftie
Contributor
Giftie commented on 42c6c6f May 23, 2012

This breakes Party mode if there is no 'filters' since it leave the WHERE in the query and it is not going to match anything

From log.
INFO: PARTY MODE MANAGER: Registering filter:[WHERE ] ERROR: SQL: SQL error or missing database Query: select idSong from songview WHERE

@jmarshallnz
Member

So it will - need to check the length of the where clause. @Montellese mind fixing?

@Montellese
Member

Sorry about that. Should be fixed with 9f2a548.

Please sign in to comment.