aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorronie <ronie@users.noreply.github.com>2020-02-08 23:19:29 +0100
committerGitHub <noreply@github.com>2020-02-08 23:19:29 +0100
commit34b17293f18a13ef6a6464d53ab745f53f9bcff4 (patch)
tree2fdd8260fe7e83f19d93d60b530ae353f2289d3e
parentfc339109041eed041c17ec9727fe190027c3f9fc (diff)
parentc384df867d74d2b14f6505e42e9bdc5050875d24 (diff)
Merge pull request #17313 from ronie/hidewatchedtv
fix 'Show empty TV Shows' for xml library node
-rw-r--r--xbmc/video/VideoDatabase.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index e7444f77aa..9e352e8309 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -7136,7 +7136,13 @@ bool CVideoDatabase::GetItems(const std::string &strBaseDir, VIDEODB_CONTENT_TYP
if (StringUtils::EqualsNoCase(itemType, "movies") && (mediaType == VIDEODB_CONTENT_MOVIES || mediaType == VIDEODB_CONTENT_MOVIE_SETS))
return GetMoviesByWhere(strBaseDir, filter, items, sortDescription);
else if (StringUtils::EqualsNoCase(itemType, "tvshows") && mediaType == VIDEODB_CONTENT_TVSHOWS)
- return GetTvShowsByWhere(strBaseDir, filter, items, sortDescription);
+ {
+ Filter extFilter = filter;
+ if (!CServiceBroker::GetSettingsComponent()->GetSettings()->
+ GetBool(CSettings::SETTING_VIDEOLIBRARY_SHOWEMPTYTVSHOWS))
+ extFilter.AppendWhere("totalCount IS NOT NULL AND totalCount > 0");
+ return GetTvShowsByWhere(strBaseDir, extFilter, items, sortDescription);
+ }
else if (StringUtils::EqualsNoCase(itemType, "musicvideos") && mediaType == VIDEODB_CONTENT_MUSICVIDEOS)
return GetMusicVideosByWhere(strBaseDir, filter, items, true, sortDescription);
else if (StringUtils::EqualsNoCase(itemType, "episodes") && mediaType == VIDEODB_CONTENT_EPISODES)