ConfigurationPageInfo.cs 1.9 KB

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