Generated response

This commit is contained in:
2026-05-14 19:53:26 +02:00
parent 7aef20fe71
commit deb4bfda90
33 changed files with 1555 additions and 102 deletions
@@ -3,7 +3,9 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Musify.Application.Abstractions.Infrastructure;
using Musify.Application.Configuration;
using Musify.Infrastructure.Configuration;
using Musify.Infrastructure.Jobs;
namespace Musify.Infrastructure.Services
{
@@ -41,6 +43,31 @@ namespace Musify.Infrastructure.Services
return serviceDescriptors;
}
// Called by both the web API host and the worker
public static IServiceCollection AddUploadIntentConfiguration(this IServiceCollection serviceDescriptors, IConfiguration configuration)
{
serviceDescriptors
.AddOptionsWithValidateOnStart<UploadIntentConfiguration>()
.Bind(configuration.GetRequiredSection(UploadIntentConfiguration.SectionName))
.ValidateDataAnnotations();
serviceDescriptors.AddSingleton(serviceProvider =>
serviceProvider.GetRequiredService<IOptions<UploadIntentConfiguration>>().Value);
return serviceDescriptors;
}
// Called only by the worker host (registers background jobs)
public static IServiceCollection AddUploadIntentJobs(this IServiceCollection serviceDescriptors, IConfiguration configuration)
{
serviceDescriptors.AddUploadIntentConfiguration(configuration);
serviceDescriptors.AddHostedService<UploadIntentExpirationJob>();
serviceDescriptors.AddHostedService<TempUploadsCleanupJob>();
return serviceDescriptors;
}
public static IServiceCollection AddAudioTranscoder(this IServiceCollection serviceDescriptors, IConfiguration configuration)
{
serviceDescriptors