From 64fb173dad77a38273548434bee683b85e323345 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 20 Jun 2020 15:59:41 +0200 Subject: Move DashboardController to Jellyfin.Api --- Jellyfin.Api/Models/ConfigurationPageInfo.cs | 85 ++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Jellyfin.Api/Models/ConfigurationPageInfo.cs (limited to 'Jellyfin.Api/Models/ConfigurationPageInfo.cs') diff --git a/Jellyfin.Api/Models/ConfigurationPageInfo.cs b/Jellyfin.Api/Models/ConfigurationPageInfo.cs new file mode 100644 index 000000000..2aa6373aa --- /dev/null +++ b/Jellyfin.Api/Models/ConfigurationPageInfo.cs @@ -0,0 +1,85 @@ +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; } + } +} -- cgit v1.2.3