Skip to content

Commit

Permalink
videodb: fix missing "where" in GetMusicVideoCount and GetRandomMusic…
Browse files Browse the repository at this point in the history
…Video
  • Loading branch information
Montellese committed Oct 8, 2012
1 parent e5bbb0f commit 33ea386
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xbmc/video/VideoDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6310,7 +6310,7 @@ int CVideoDatabase::GetMusicVideoCount(const CStdString& strWhere)
if (NULL == m_pDS.get()) return 0;

CStdString strSQL;
strSQL.Format("select count(1) as nummovies from musicvideoview %s",strWhere.c_str());
strSQL.Format("select count(1) as nummovies from musicvideoview where %s",strWhere.c_str());
m_pDS->query( strSQL.c_str() );

int iResult = 0;
Expand Down Expand Up @@ -7017,7 +7017,7 @@ bool CVideoDatabase::GetRandomMusicVideo(CFileItem* item, int& idSong, const CSt

// We don't use PrepareSQL here, as the WHERE clause is already formatted.
CStdString strSQL;
strSQL.Format("select * from musicvideoview %s order by idMVideo limit 1 offset %i",strWhere.c_str(),iRandom);
strSQL.Format("select * from musicvideoview where %s order by idMVideo limit 1 offset %i",strWhere.c_str(),iRandom);
CLog::Log(LOGDEBUG, "%s query = %s", __FUNCTION__, strSQL.c_str());
// run query
if (!m_pDS->query(strSQL.c_str()))
Expand Down

0 comments on commit 33ea386

Please sign in to comment.