Skip to content

Commit

Permalink
Hide movies and series from "Videos"
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheusxx committed May 8, 2016
1 parent 8d8ee67 commit 392a982
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Expand Up @@ -27,6 +27,7 @@
using System.Linq;
using MediaPortal.Common.Commands;
using MediaPortal.Common.MediaManagement.DefaultItemAspects;
using MediaPortal.Common.MediaManagement.MLQueries;
using MediaPortal.UiComponents.Media.General;
using MediaPortal.UiComponents.Media.Models.Navigation;
using MediaPortal.UiComponents.Media.Models.ScreenData;
Expand All @@ -53,6 +54,7 @@ public abstract class BaseNavigationInitializer : IMediaNavigationInitializer
protected AbstractItemsScreenData.PlayableItemCreatorDelegate _genericPlayableItemCreatorDelegate;
protected ViewSpecification _customRootViewSpecification;
protected IEnumerable<string> _restrictedMediaCategories = null;
protected IFilter _filter = null; // Can be set by derived classes to apply an inital filter

#endregion

Expand Down Expand Up @@ -114,7 +116,7 @@ public virtual void InitMediaNavigation(out string mediaNavigationMode, out Navi
IEnumerable<Guid> skinDependentOptionalMIATypeIDs = MediaNavigationModel.GetMediaSkinOptionalMIATypes(MediaNavigationMode);
// Prefer custom view specification.
ViewSpecification rootViewSpecification = _customRootViewSpecification ??
new MediaLibraryQueryViewSpecification(_viewName, null, _necessaryMias, skinDependentOptionalMIATypeIDs, true)
new MediaLibraryQueryViewSpecification(_viewName, _filter, _necessaryMias, skinDependentOptionalMIATypeIDs, true)
{
MaxNumItems = Consts.MAX_NUM_ITEMS_VISIBLE
};
Expand Down
Expand Up @@ -23,6 +23,8 @@
#endregion

using System.Collections.Generic;
using MediaPortal.Common.MediaManagement.DefaultItemAspects;
using MediaPortal.Common.MediaManagement.MLQueries;
using MediaPortal.UiComponents.Media.General;
using MediaPortal.UiComponents.Media.Models.ScreenData;
using MediaPortal.UiComponents.Media.Models.Sorting;
Expand All @@ -46,6 +48,12 @@ protected override void Prepare()
{
base.Prepare();

_filter = new BooleanCombinationFilter(BooleanOperator.And, new List<IFilter>
{
new EmptyFilter(SeriesAspect.ATTR_SERIESNAME),
new EmptyFilter(MovieAspect.ATTR_MOVIE_NAME),
});

_defaultScreen = new VideosFilterByGenreScreenData();
_availableScreens = new List<AbstractScreenData>
{
Expand Down

0 comments on commit 392a982

Please sign in to comment.