jellypod/Jellyfin.Plugin.Jellypod/PluginServiceRegistrator.cs
Duncan Tourolle c1f7981ed7
All checks were successful
🏗️ Build Plugin / build (push) Successful in 1m59s
🧪 Test Plugin / test (push) Successful in 56s
🚀 Release Plugin / build-and-release (push) Successful in 1m56s
Add progress and complettion indication
2025-12-14 11:11:26 +01:00

37 lines
1.3 KiB
C#

using Jellyfin.Plugin.Jellypod.Channels;
using Jellyfin.Plugin.Jellypod.Services;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Plugins;
using Microsoft.Extensions.DependencyInjection;
namespace Jellyfin.Plugin.Jellypod;
/// <summary>
/// Registers plugin services with the dependency injection container.
/// </summary>
public class PluginServiceRegistrator : IPluginServiceRegistrator
{
/// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
// Register HTTP client
serviceCollection.AddHttpClient("Jellypod", client =>
{
client.DefaultRequestHeaders.Add("User-Agent", "Jellypod/1.0 (Jellyfin Podcast Plugin)");
client.Timeout = System.TimeSpan.FromMinutes(10);
});
// Register services
serviceCollection.AddSingleton<IRssFeedService, RssFeedService>();
serviceCollection.AddSingleton<IPodcastStorageService, PodcastStorageService>();
serviceCollection.AddSingleton<IPodcastDownloadService, PodcastDownloadService>();
// Register channel
serviceCollection.AddSingleton<IChannel, JellypodChannel>();
// Register playback reporting service
serviceCollection.AddHostedService<PlaybackReportingService>();
}
}