jellypod/Jellyfin.Plugin.Jellypod/PluginServiceRegistrator.cs
Duncan Tourolle 4679b77d1a
Some checks failed
🏗️ Build Plugin / call (push) Failing after 0s
📝 Create/Update Release Draft & Release Bump PR / call (push) Failing after 0s
🔬 Run CodeQL / call (push) Failing after 0s
🧪 Test Plugin / call (push) Failing after 0s
First POC with podcasts library
2025-12-13 23:57:58 +01:00

34 lines
1.2 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>();
}
}