using MediaBrowser.Common.Plugins; using MediaBrowser.Controller.Plugins; using MediaBrowser.Model.Plugins; namespace Jellyfin.Api.Models { /// /// The configuration page info. /// public class ConfigurationPageInfo { /// /// Initializes a new instance of the class. /// /// Instance of interface. public ConfigurationPageInfo(IPluginConfigurationPage page) { Name = page.Name; ConfigurationPageType = page.ConfigurationPageType; if (page.Plugin != null) { DisplayName = page.Plugin.Name; // Don't use "N" because it needs to match Plugin.Id PluginId = page.Plugin.Id.ToString(); } } /// /// Initializes a new instance of the class. /// /// Instance of interface. /// Instance of interface. public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page) { Name = page.Name; EnableInMainMenu = page.EnableInMainMenu; MenuSection = page.MenuSection; MenuIcon = page.MenuIcon; DisplayName = string.IsNullOrWhiteSpace(page.DisplayName) ? plugin.Name : page.DisplayName; // Don't use "N" because it needs to match Plugin.Id PluginId = plugin.Id.ToString(); } /// /// Gets or sets the name. /// /// The name. public string Name { get; set; } /// /// Gets or sets a value indicating whether the configurations page is enabled in the main menu. /// public bool EnableInMainMenu { get; set; } /// /// Gets or sets the menu section. /// public string? MenuSection { get; set; } /// /// Gets or sets the menu icon. /// public string? MenuIcon { get; set; } /// /// Gets or sets the display name. /// public string? DisplayName { get; set; } /// /// Gets or sets the type of the configuration page. /// /// The type of the configuration page. public ConfigurationPageType ConfigurationPageType { get; set; } /// /// Gets or sets the plugin id. /// /// The plugin id. public string? PluginId { get; set; } } }