Skip to content
This repository
Browse code

fixes GetRandomMusicVideo query on mysql

  • Loading branch information...
commit bf913624585bc21ebe3a870c51f28872ef41163c 1 parent 7118b76
authored May 13, 2013

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  xbmc/video/VideoDatabase.cpp
3  xbmc/video/VideoDatabase.cpp
@@ -7411,7 +7411,8 @@ bool CVideoDatabase::GetRandomMusicVideo(CFileItem* item, int& idSong, const CSt
7411 7411
 
7412 7412
     // We don't use PrepareSQL here, as the WHERE clause is already formatted.
7413 7413
     CStdString strSQL;
7414  
-    strSQL.Format("select * from musicvideoview where %s order by RANDOM() limit 1",strWhere.c_str());
  7414
+    strSQL.Format("select * from musicvideoview where %s",strWhere.c_str());
  7415
+    strSQL += PrepareSQL(" order by RANDOM() limit 1");
7415 7416
     CLog::Log(LOGDEBUG, "%s query = %s", __FUNCTION__, strSQL.c_str());
7416 7417
     // run query
7417 7418
     if (!m_pDS->query(strSQL.c_str()))

0 notes on commit bf91362

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