jellypod/Jellyfin.Plugin.Jellypod/PluginServiceRegistrator.cs
Duncan Tourolle 003a8754a6
All checks were successful
🚀 Release Plugin / build-and-release (push) Successful in 2m3s
🏗️ Build Plugin / build (push) Successful in 2m0s
🧪 Test Plugin / test (push) Successful in 59s
Added OPML support
2025-12-16 20:31:46 +01:00

38 lines
1.4 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>();
serviceCollection.AddSingleton<IOpmlService, OpmlService>();
// Register channel
serviceCollection.AddSingleton<IChannel, JellypodChannel>();
// Register playback reporting service
serviceCollection.AddHostedService<PlaybackReportingService>();
}
}