BasePluginFolder.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. /// We don't resolve normally so need to fill this in
  34. /// </summary>
  35. public override string DisplayMediaType
  36. {
  37. get
  38. {
  39. return "CollectionFolder"; // Plug-in folders are collection folders
  40. }
  41. set
  42. {
  43. base.DisplayMediaType = value;
  44. }
  45. }
  46. }
  47. }