ICollectionFolder.cs 944 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace MediaBrowser.Controller.Entities
  5. {
  6. /// <summary>
  7. /// This is just a marker interface to denote top level folders
  8. /// </summary>
  9. public interface ICollectionFolder
  10. {
  11. string CollectionType { get; }
  12. string Path { get; }
  13. string Name { get; }
  14. Guid Id { get; }
  15. IEnumerable<string> PhysicalLocations { get; }
  16. }
  17. public interface ISupportsUserSpecificView
  18. {
  19. bool EnableUserSpecificView { get; }
  20. }
  21. public static class CollectionFolderExtensions
  22. {
  23. public static string GetViewType(this ICollectionFolder folder, User user)
  24. {
  25. if (user.Configuration.PlainFolderViews.Contains(folder.Id.ToString("N"), StringComparer.OrdinalIgnoreCase))
  26. {
  27. return null;
  28. }
  29. return folder.CollectionType;
  30. }
  31. }
  32. }