59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using Jellyfin.Plugin.MediaCleaner.Configuration;
|
|
using MediaBrowser.Common.Configuration;
|
|
using MediaBrowser.Common.Plugins;
|
|
using MediaBrowser.Controller.Entities;
|
|
using MediaBrowser.Model.Plugins;
|
|
using MediaBrowser.Model.Serialization;
|
|
|
|
namespace Jellyfin.Plugin.MediaCleaner;
|
|
|
|
/// <summary>
|
|
/// The main plugin.
|
|
/// </summary>
|
|
public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="Plugin"/> class.
|
|
/// </summary>
|
|
/// <param name="applicationPaths">Instance of the <see cref="IApplicationPaths"/> interface.</param>
|
|
/// <param name="xmlSerializer">Instance of the <see cref="IXmlSerializer"/> interface.</param>
|
|
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
|
|
: base(applicationPaths, xmlSerializer)
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override string Name => "Media Cleaner";
|
|
|
|
/// <inheritdoc />
|
|
public override Guid Id => Guid.Parse("fef007a8-3e8f-4aa8-a22e-486a387f4192");
|
|
|
|
/// <summary>
|
|
/// Gets the current plugin instance.
|
|
/// </summary>
|
|
public static Plugin? Instance { get; private set; }
|
|
|
|
/// <inheritdoc />
|
|
public IEnumerable<PluginPageInfo> GetPages()
|
|
{
|
|
return
|
|
[
|
|
new PluginPageInfo
|
|
{
|
|
Name = "Settings",
|
|
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Configuration.settings.html", GetType().Namespace),
|
|
},
|
|
new PluginPageInfo
|
|
{
|
|
Name = "Home",
|
|
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Pages.home.html", GetType().Namespace),
|
|
EnableInMainMenu = true,
|
|
},
|
|
];
|
|
}
|
|
}
|