using System; using System.Collections.Generic; using Jellyfin.Plugin.SSO_Auth.Config; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Plugins; using MediaBrowser.Model.Plugins; using MediaBrowser.Model.Serialization; namespace Jellyfin.Plugin.SSO_Auth; /// /// The SSO plugin class. /// public class SSOPlugin : BasePlugin, IPlugin, IHasWebPages { /// /// Initializes a new instance of the class. /// /// Internal Jellyfin interface for the ApplicationPath. /// Internal Jellyfin interface for the XML information. public SSOPlugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer) { Instance = this; } /// /// Gets the instance of the SSO plugin. /// public static SSOPlugin Instance { get; private set; } /// /// Gets the name of the SSO plugin. /// public override string Name => "SSO-Auth"; /// /// Gets the GUID of the SSO plugin. /// public override Guid Id => Guid.Parse("505ce9d1-d916-42fa-86ca-673ef241d7df"); /// /// Returns the available internal web pages of this plugin. /// /// A list of internal webpages in this application. public IEnumerable GetPages() { return new[] { new PluginPageInfo { Name = Name, EmbeddedResourcePath = $"{GetType().Namespace}.Config.configPage.html" }, new PluginPageInfo { Name = Name + ".js", EmbeddedResourcePath = $"{GetType().Namespace}.Config.config.js" }, new PluginPageInfo { Name = Name + ".css", EmbeddedResourcePath = $"{GetType().Namespace}.Config.style.css" }, new PluginPageInfo { Name = Name + "-linking", EmbeddedResourcePath = $"{GetType().Namespace}.Config.linking.html" }, new PluginPageInfo { Name = Name + "-linking.js", EmbeddedResourcePath = $"{GetType().Namespace}.Config.linking.js" }, }; } /// /// Returns the available user views for this plugin. /// /// A list of user views for this plugin. public IEnumerable GetViews() { return new[] { new PluginPageInfo { Name = Name + ".css", EmbeddedResourcePath = $"{GetType().Namespace}.Config.style.css" }, new PluginPageInfo { Name = Name + "-linking", EmbeddedResourcePath = $"{GetType().Namespace}.Config.linking.html" }, new PluginPageInfo { Name = Name + "-linking.js", EmbeddedResourcePath = $"{GetType().Namespace}.Config.linking.js" }, new PluginPageInfo { Name = Name + "-ApiClient.js", EmbeddedResourcePath = $"{GetType().Namespace}.Views.apiClient.js" }, }; } }