From bf913624585bc21ebe3a870c51f28872ef41163c Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Mon, 13 May 2013 08:57:08 +1200 Subject: [PATCH] fixes GetRandomMusicVideo query on mysql --- xbmc/video/VideoDatabase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index eeb9a4a8b1dd4..f6e29cac33d16 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -7411,7 +7411,8 @@ 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 where %s order by RANDOM() limit 1",strWhere.c_str()); + strSQL.Format("select * from musicvideoview where %s",strWhere.c_str()); + strSQL += PrepareSQL(" order by RANDOM() limit 1"); CLog::Log(LOGDEBUG, "%s query = %s", __FUNCTION__, strSQL.c_str()); // run query if (!m_pDS->query(strSQL.c_str()))