jellyfin/MediaBrowser.Server.Implementations/Collections/ManualCollectionsFolder.cs

45 lines
1.1 KiB
C#
Raw Normal View History

2014-06-23 09:05:19 -07:00
using MediaBrowser.Controller.Entities;
2015-01-24 15:33:26 -07:00
using MediaBrowser.Controller.Entities.Movies;
2014-06-23 09:05:19 -07:00
using System.Linq;
namespace MediaBrowser.Server.Implementations.Collections
{
public class ManualCollectionsFolder : BasePluginFolder
{
public ManualCollectionsFolder()
{
Name = "Collections";
DisplayMediaType = "CollectionFolder";
}
public override bool IsVisible(User user)
{
2015-01-22 23:15:15 -07:00
return base.IsVisible(user) && GetChildren(user, false)
2015-01-24 15:33:26 -07:00
.OfType<BoxSet>()
.Any(i => i.IsVisible(user));
}
public override bool IsHidden
{
get
{
2014-06-30 21:26:50 -07:00
return true;
}
}
2014-06-21 22:52:31 -07:00
2014-06-30 21:06:28 -07:00
public override bool IsHiddenFromUser(User user)
{
2014-07-13 14:03:57 -07:00
return !user.Configuration.DisplayCollectionsView;
2014-06-30 21:06:28 -07:00
}
2014-06-21 22:52:31 -07:00
public override string CollectionType
{
get { return Model.Entities.CollectionType.BoxSets; }
}
2014-06-23 09:05:19 -07:00
public override string GetClientTypeName()
{
return typeof (CollectionFolder).Name;
}
}
}