using System; using System.Collections.Generic; using System.Globalization; using Jellyfin.Plugin.JRay.Configuration; using Jellyfin.Plugin.JRay.Services; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Plugins; using MediaBrowser.Model.Plugins; using MediaBrowser.Model.Serialization; using Microsoft.Extensions.Logging; namespace Jellyfin.Plugin.JRay; /// /// The main plugin. /// public class Plugin : BasePlugin, IHasWebPages { private readonly ILogger _logger; /// /// Initializes a new instance of the class. /// /// Instance of the interface. /// Instance of the interface. /// The logger. public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, ILogger logger) : base(applicationPaths, xmlSerializer) { Instance = this; _logger = logger; WebClientPatchService.Apply(ApplicationPaths, Configuration.EnableOverlay, _logger); ConfigurationChanged += (_, _) => WebClientPatchService.Apply(ApplicationPaths, Configuration.EnableOverlay, _logger); } /// public override string Name => "JRay"; /// public override Guid Id => Guid.Parse("96a22d9d-23fd-49bb-8970-5e153817d223"); /// /// Gets the current plugin instance. /// public static Plugin? Instance { get; private set; } /// public IEnumerable GetPages() { return [ new PluginPageInfo { Name = Name, EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Configuration.configPage.html", GetType().Namespace) } ]; } }