BasePluginFolder.cs 1.3 KB

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