ConfigurationPageInfo.cs 2.1 KB

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