aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Models/ConfigurationPageInfo.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2021-08-18 02:46:59 -0400
committerGitHub <noreply@github.com>2021-08-18 02:46:59 -0400
commit72d3f7020ad80ce1a53eeae8c5d57abeb22a4679 (patch)
treedd43e663838cdc7d99a4af565523df58ae23c856 /Jellyfin.Api/Models/ConfigurationPageInfo.cs
parent7aef0fce444e6d8e06386553ec7ea1401a01bbb1 (diff)
parente5cbafdb6b47377052e0d638908ef96e30a997d6 (diff)
Merge branch 'master' into patch-2
Diffstat (limited to 'Jellyfin.Api/Models/ConfigurationPageInfo.cs')
-rw-r--r--Jellyfin.Api/Models/ConfigurationPageInfo.cs44
1 files changed, 13 insertions, 31 deletions
diff --git a/Jellyfin.Api/Models/ConfigurationPageInfo.cs b/Jellyfin.Api/Models/ConfigurationPageInfo.cs
index 2aa6373aa..ec4a0d1a1 100644
--- a/Jellyfin.Api/Models/ConfigurationPageInfo.cs
+++ b/Jellyfin.Api/Models/ConfigurationPageInfo.cs
@@ -1,5 +1,5 @@
-using MediaBrowser.Common.Plugins;
-using MediaBrowser.Controller.Plugins;
+using System;
+using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Plugins;
namespace Jellyfin.Api.Models
@@ -12,36 +12,24 @@ namespace Jellyfin.Api.Models
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationPageInfo"/> class.
/// </summary>
- /// <param name="page">Instance of <see cref="IPluginConfigurationPage"/> interface.</param>
- 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();
- }
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ConfigurationPageInfo"/> class.
- /// </summary>
/// <param name="plugin">Instance of <see cref="IPlugin"/> interface.</param>
/// <param name="page">Instance of <see cref="PluginPageInfo"/> interface.</param>
- public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page)
+ 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;
+ DisplayName = string.IsNullOrWhiteSpace(page.DisplayName) ? plugin?.Name : page.DisplayName;
+ PluginId = plugin?.Id;
+ }
- // Don't use "N" because it needs to match Plugin.Id
- PluginId = plugin.Id.ToString();
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ConfigurationPageInfo"/> class.
+ /// </summary>
+ public ConfigurationPageInfo()
+ {
+ Name = string.Empty;
}
/// <summary>
@@ -71,15 +59,9 @@ namespace Jellyfin.Api.Models
public string? DisplayName { get; set; }
/// <summary>
- /// Gets or sets the type of the configuration page.
- /// </summary>
- /// <value>The type of the configuration page.</value>
- public ConfigurationPageType ConfigurationPageType { get; set; }
-
- /// <summary>
/// Gets or sets the plugin id.
/// </summary>
/// <value>The plugin id.</value>
- public string? PluginId { get; set; }
+ public Guid? PluginId { get; set; }
}
}