BasePluginFolder.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using MediaBrowser.Common.Extensions;
  2. using System;
  3. using MediaBrowser.Model.Entities;
  4. namespace MediaBrowser.Controller.Entities
  5. {
  6. /// <summary>
  7. /// Plugins derive from and export this class to create a folder that will appear in the root along
  8. /// with all the other actual physical folders in the system.
  9. /// </summary>
  10. public abstract class BasePluginFolder : Folder, ICollectionFolder, IByReferenceItem
  11. {
  12. /// <summary>
  13. /// Gets or sets the id.
  14. /// </summary>
  15. /// <value>The id.</value>
  16. public override Guid Id
  17. {
  18. get
  19. {
  20. // This doesn't get populated through the normal resolving process
  21. if (base.Id == Guid.Empty)
  22. {
  23. base.Id = (Path ?? Name).GetMBId(GetType());
  24. }
  25. return base.Id;
  26. }
  27. set
  28. {
  29. base.Id = value;
  30. }
  31. }
  32. /// <summary>
  33. /// Gets or sets the type of the location.
  34. /// </summary>
  35. /// <value>The type of the location.</value>
  36. public override LocationType LocationType
  37. {
  38. get
  39. {
  40. return LocationType.Virtual;
  41. }
  42. }
  43. /// <summary>
  44. /// We don't resolve normally so need to fill this in
  45. /// </summary>
  46. public override string DisplayMediaType
  47. {
  48. get
  49. {
  50. return "CollectionFolder"; // Plug-in folders are collection folders
  51. }
  52. set
  53. {
  54. base.DisplayMediaType = value;
  55. }
  56. }
  57. }
  58. }