Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix query for filtering movies in sets with a where clause, thanks to…

… Montellese
  • Loading branch information...
commit 4aab872a432ecdf80c8a26a933805bc2db1792b4 1 parent ddebc7a
Jonathan Marshall authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 xbmc/video/VideoDatabase.cpp
View
5 xbmc/video/VideoDatabase.cpp
@@ -4717,10 +4717,11 @@ bool CVideoDatabase::GetMoviesByWhere(const CStdString& strBaseDir, const CStdSt
if (where.size())
setsWhere = " where movie.idMovie in (select movieview.idMovie from movieview " + where + ")";
GetSetsNav("videodb://1/7/", items, VIDEODB_CONTENT_MOVIES, setsWhere);
+ CStdString movieSetsWhere = "movieview.idMovie NOT IN (SELECT idMovie FROM setlinkmovie s1 JOIN(SELECT idSet, COUNT(1) AS c FROM setlinkmovie GROUP BY idSet HAVING c>1) s2 ON s2.idSet=s1.idSet)";
if (where.size())
- strSQL += where + PrepareSQL(" and movieview.idMovie NOT in (SELECT idMovie FROM setlinkmovie GROUP BY idSet HAVING COUNT(idMovie) > 1)");
+ strSQL += where + PrepareSQL(" and " + movieSetsWhere);
else
- strSQL += PrepareSQL("WHERE movieview.idMovie NOT IN (SELECT idMovie FROM setlinkmovie s1 JOIN(SELECT idSet, COUNT(1) AS c FROM setlinkmovie GROUP BY idSet HAVING c>1) s2 ON s2.idSet=s1.idSet)");
+ strSQL += PrepareSQL(" WHERE " + movieSetsWhere);
}
else
strSQL += where;
Please sign in to comment.
Something went wrong with that request. Please try again.