ManualCollectionsFolder.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using MediaBrowser.Controller.Entities;
  2. using MediaBrowser.Controller.Entities.Movies;
  3. using System.Linq;
  4. namespace MediaBrowser.Server.Implementations.Collections
  5. {
  6. public class ManualCollectionsFolder : BasePluginFolder
  7. {
  8. public ManualCollectionsFolder()
  9. {
  10. Name = "Collections";
  11. DisplayMediaType = "CollectionFolder";
  12. }
  13. public override bool IsVisible(User user)
  14. {
  15. return base.IsVisible(user) && GetChildren(user, false).Any();
  16. }
  17. public override bool IsHidden
  18. {
  19. get
  20. {
  21. return true;
  22. }
  23. }
  24. public override bool IsHiddenFromUser(User user)
  25. {
  26. return !user.Configuration.DisplayCollectionsView;
  27. }
  28. public override string CollectionType
  29. {
  30. get { return Model.Entities.CollectionType.BoxSets; }
  31. }
  32. public override string GetClientTypeName()
  33. {
  34. return typeof (CollectionFolder).Name;
  35. }
  36. }
  37. }