using System;
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;
PluginId = page.Plugin.Id;
}
}
///
/// 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;
PluginId = plugin?.Id;
}
///
/// 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 Guid? PluginId { get; set; }
}
}