jellyfin-smart-playlist/Jellyfin.Plugin.SmartPlaylist/Plugin.cs

70 lines
3.4 KiB
C#
Raw Normal View History

2024-06-27 01:47:44 +02:00
using System.Globalization;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Serialization;
2024-12-21 01:09:41 +01:00
using MediaBrowser.Controller;
using MediaBrowser.Controller.Library;
2024-06-27 01:47:44 +02:00
namespace Jellyfin.Plugin.SmartPlaylist {
public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages {
2024-12-21 01:09:41 +01:00
public IServerApplicationPaths ServerApplicationPaths;
public IUserManager UserManager;
2024-06-27 01:47:44 +02:00
public Plugin(
IApplicationPaths applicationPaths,
2024-12-21 01:09:41 +01:00
IXmlSerializer xmlSerializer,
IServerApplicationPaths serverApplicationPaths,
IUserManager userManager
2024-06-27 01:47:44 +02:00
) : base (applicationPaths, xmlSerializer) {
Instance = this;
2024-12-21 01:09:41 +01:00
ServerApplicationPaths = serverApplicationPaths;
UserManager = userManager;
2024-06-27 01:47:44 +02:00
}
public static Plugin? Instance {get; private set; }
public override string Name => "Smart Playlist";
public override Guid Id => Guid.Parse("dd2326e3-4d3e-4bfc-80e6-28502c1131df");
public IEnumerable<PluginPageInfo> GetPages() {
return new[] {
new PluginPageInfo {
Name = this.Name,
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Configuration.configPage.html", GetType().Namespace),
},
new PluginPageInfo {
Name = "configPage.js",
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Configuration.configPage.js", GetType().Namespace),
},
new PluginPageInfo {
Name = "Smart Playlists",
2025-01-19 22:28:32 +01:00
DisplayName = "Smart Playlists",
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Pages.smartPlaylists.html", GetType().Namespace),
EnableInMainMenu = true,
},
new PluginPageInfo {
Name = "smartPlaylists.js",
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Pages.smartPlaylists.js", GetType().Namespace),
},
new PluginPageInfo {
Name = "Smart Collections",
2025-01-19 22:28:32 +01:00
DisplayName = "Smart Collections",
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Pages.smartCollections.html", GetType().Namespace),
2025-01-19 22:28:32 +01:00
EnableInMainMenu = true,
},
new PluginPageInfo {
Name = "smartCollections.js",
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Pages.smartCollections.js", GetType().Namespace),
},
2025-01-19 23:59:24 +01:00
new PluginPageInfo {
Name = "Lisp Playground",
DisplayName = "Lisp Playground",
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Pages.lispPlayground.html", GetType().Namespace),
EnableInMainMenu = true,
},
new PluginPageInfo {
Name = "lispPlayground.js",
EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Pages.lispPlayground.js", GetType().Namespace),
},
2024-06-27 01:47:44 +02:00
};
}
}
}