using Jellyfin.Plugin.JellyLMS.Services;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
using Microsoft.Extensions.DependencyInjection;
namespace Jellyfin.Plugin.JellyLMS;
///
/// Registers plugin services with Jellyfin's DI container.
///
public class PluginServiceRegistrator : IPluginServiceRegistrator
{
///
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
serviceCollection.AddHostedService(sp => sp.GetRequiredService());
// Device discovery service - registers LMS players as Jellyfin sessions for casting
// Use AddHostedService directly to let DI handle construction
serviceCollection.AddHostedService();
}
}