Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "changed: show the actual movies instead of the sets item when…

… browsing the virtual nodes (genre,studio and the likes) - only titles node will show the sets item"

This reverts commit d16a63c.

Conflicts:

	xbmc/video/VideoDatabase.cpp
  • Loading branch information...
commit ddebc7ae6e0385a285103a643c16cb620ec20ba5 1 parent 873c854
Jonathan Marshall authored
Showing with 12 additions and 9 deletions.
  1. +12 −9 xbmc/video/VideoDatabase.cpp
View
21 xbmc/video/VideoDatabase.cpp
@@ -4710,17 +4710,20 @@ bool CVideoDatabase::GetMoviesByWhere(const CStdString& strBaseDir, const CStdSt
if (NULL == m_pDS.get()) return false;
CStdString strSQL = "select * from movieview ";
-
- if (where.size())
- strSQL += where;
- else
- {
- if (fetchSets && g_guiSettings.GetBool("videolibrary.groupmoviesets"))
- {
- GetSetsNav("videodb://1/7/", items, VIDEODB_CONTENT_MOVIES, "");
+ if (fetchSets && g_guiSettings.GetBool("videolibrary.groupmoviesets"))
+ {
+ // user wants sets (and we're not fetching a particular set node), so grab all sets that match this where clause first
+ CStdString setsWhere;
+ if (where.size())
+ setsWhere = " where movie.idMovie in (select movieview.idMovie from movieview " + where + ")";
+ GetSetsNav("videodb://1/7/", items, VIDEODB_CONTENT_MOVIES, setsWhere);
+ if (where.size())
+ strSQL += where + PrepareSQL(" and movieview.idMovie NOT in (SELECT idMovie FROM setlinkmovie GROUP BY idSet HAVING COUNT(idMovie) > 1)");
+ 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)");
- }
}
+ else
+ strSQL += where;
if (order.size())
strSQL += " " + order;
Please sign in to comment.
Something went wrong with that request. Please try again.