ConfigurationPageInfo.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using MediaBrowser.Common.Plugins;
  3. using MediaBrowser.Controller.Plugins;
  4. using MediaBrowser.Model.Plugins;
  5. namespace Jellyfin.Api.Models
  6. {
  7. /// <summary>
  8. /// The configuration page info.
  9. /// </summary>
  10. public class ConfigurationPageInfo
  11. {
  12. /// <summary>
  13. /// Initializes a new instance of the <see cref="ConfigurationPageInfo"/> class.
  14. /// </summary>
  15. /// <param name="plugin">Instance of <see cref="IPlugin"/> interface.</param>
  16. /// <param name="page">Instance of <see cref="PluginPageInfo"/> interface.</param>
  17. public ConfigurationPageInfo(IPlugin? plugin, PluginPageInfo page)
  18. {
  19. Name = page.Name;
  20. EnableInMainMenu = page.EnableInMainMenu;
  21. MenuSection = page.MenuSection;
  22. MenuIcon = page.MenuIcon;
  23. DisplayName = string.IsNullOrWhiteSpace(page.DisplayName) ? plugin?.Name : page.DisplayName;
  24. PluginId = plugin?.Id;
  25. }
  26. /// <summary>
  27. /// Gets or sets the name.
  28. /// </summary>
  29. /// <value>The name.</value>
  30. public string Name { get; set; }
  31. /// <summary>
  32. /// Gets or sets a value indicating whether the configurations page is enabled in the main menu.
  33. /// </summary>
  34. public bool EnableInMainMenu { get; set; }
  35. /// <summary>
  36. /// Gets or sets the menu section.
  37. /// </summary>
  38. public string? MenuSection { get; set; }
  39. /// <summary>
  40. /// Gets or sets the menu icon.
  41. /// </summary>
  42. public string? MenuIcon { get; set; }
  43. /// <summary>
  44. /// Gets or sets the display name.
  45. /// </summary>
  46. public string? DisplayName { get; set; }
  47. /// <summary>
  48. /// Gets or sets the type of the configuration page.
  49. /// </summary>
  50. /// <value>The type of the configuration page.</value>
  51. public ConfigurationPageType ConfigurationPageType { get; set; }
  52. /// <summary>
  53. /// Gets or sets the plugin id.
  54. /// </summary>
  55. /// <value>The plugin id.</value>
  56. public Guid? PluginId { get; set; }
  57. }
  58. }