2026-10-19 15:22:34 +01:00
|
|
|
using Yavsc.Services;
|
|
|
|
|
|
|
|
|
|
namespace Yavsc.Api.Services;
|
|
|
|
|
|
|
|
|
|
public static class PodcastServiceCollectionExtensions
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection AddPodcasts(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
services.Configure<PodcastOptions>(configuration.GetSection("Podcast"));
|
2026-11-08 07:43:15 +00:00
|
|
|
services.Configure<PodcastObsOptions>(configuration.GetSection("Podcast:Obs"));
|
|
|
|
|
services.AddScoped<IPodcastObsService, PodcastObsService>();
|
|
|
|
|
services.AddHttpClient<IPodcastObsRelay, PodcastObsRelay>(client => client.Timeout = TimeSpan.FromSeconds(10))
|
|
|
|
|
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false });
|
|
|
|
|
services.AddHostedService<PodcastObsWorker>();
|
2026-10-19 15:22:34 +01:00
|
|
|
services.AddSingleton<ILiveProcessor, LiveProcessor>();
|
2026-11-02 14:08:22 +00:00
|
|
|
services.AddScoped<IPodcastScheduleService, PodcastScheduleService>();
|
2026-10-25 00:48:53 +01:00
|
|
|
services.AddSingleton<IPodcastReplayRemuxer, FfmpegPodcastReplayRemuxer>();
|
|
|
|
|
services.AddHostedService<PodcastReplayWorker>();
|
2026-10-19 15:22:34 +01:00
|
|
|
services.AddOpenApi("podcasts", options => options.ShouldInclude = description => description.GroupName == "podcasts");
|
|
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|