21 lines
847 B
C#
21 lines
847 B
C#
using Jellyfin.Plugin.Vanguard.Services;
|
|
using MediaBrowser.Controller;
|
|
using MediaBrowser.Controller.Plugins;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Jellyfin.Plugin.Vanguard;
|
|
|
|
/// <summary>Registers the plugin's services with Jellyfin's DI container.</summary>
|
|
public sealed class ServiceRegistrator : IPluginServiceRegistrator
|
|
{
|
|
public void RegisterServices(IServiceCollection services, IServerApplicationHost applicationHost)
|
|
{
|
|
services.AddSingleton<DiscordClient>();
|
|
services.AddSingleton<AuthentikClient>();
|
|
services.AddSingleton<LibraryPaths>();
|
|
services.AddSingleton<IdentityResolver>();
|
|
services.AddHostedService<FeedService>();
|
|
services.AddSingleton(sp => new EventStore(Plugin.Instance?.DataFolderPath ?? Path.Combine(Path.GetTempPath(), "vanguard")));
|
|
}
|
|
}
|