using Yavsc.Services; namespace Yavsc.Api.Services; public static class PodcastServiceCollectionExtensions { public static IServiceCollection AddPodcasts(this IServiceCollection services, IConfiguration configuration) { services.Configure(configuration.GetSection("Podcast")); services.Configure(configuration.GetSection("Podcast:Obs")); services.AddScoped(); services.AddHttpClient(client => client.Timeout = TimeSpan.FromSeconds(10)) .ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false }); services.AddHostedService(); services.AddSingleton(); services.AddScoped(); services.AddSingleton(); services.AddHostedService(); services.AddOpenApi("podcasts", options => options.ShouldInclude = description => description.GroupName == "podcasts"); return services; } }