Formatting

This commit is contained in:
2026-07-05 16:04:53 +02:00
parent b1010b0bb5
commit a37dcc1b45
9 changed files with 22 additions and 22 deletions
@@ -36,7 +36,7 @@ public sealed class OpenApiOptionsSetup(IOptions<AuthenticationConfiguration> op
};
return Task.CompletedTask;
});
} );
options.AddOperationTransformer((operation, context, _) =>
{
@@ -58,9 +58,9 @@ public sealed class OpenApiOptionsSetup(IOptions<AuthenticationConfiguration> op
{
[new OpenApiSecuritySchemeReference(SecuritySchemeId, context.Document)] =
_configuration.Scopes.ToList(),
});
} );
return Task.CompletedTask;
});
} );
}
}
@@ -84,7 +84,7 @@ namespace Musify.Application.PlayLists
await database.SaveChangesAsync(cancellationToken);
await transaction.CommitAsync(cancellationToken);
logger.LogInformation("Issued upload intent {IntentId} for user {UserId} (PlayListPicture, temp key: {Key})", intent.Id, request.UserId, tempKey);
logger.LogInformation("Issued upload intent {IntentId} for user {UserId} (PlayListPicture, temp key: {Key} )", intent.Id, request.UserId, tempKey);
return new PlayListPictureUploadResponse(
intent.Id,
@@ -24,7 +24,7 @@ namespace Musify.Application.Tracks
{
var track = await database.Tracks.AsNoTracking()
.Where(t => t.Id == request.TrackId)
.Select(t => new { t.Id, t.AudioTranscodeProcessingStatus, t.AudioFolderName })
.Select(t => new { t.Id, t.AudioTranscodeProcessingStatus, t.AudioFolderName } )
.SingleOrDefaultAsync(cancellationToken);
if (track is null)
@@ -15,7 +15,7 @@ namespace Musify.Infrastructure.Jobs
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
logger.LogInformation("TemporalUploadsCleanUpJob started (interval: {Interval}s, prefix: {Prefix})",
logger.LogInformation("TemporalUploadsCleanUpJob started (interval: {Interval}s, prefix: {Prefix} )",
uploadIntentConfiguration.TemporalCleanUpJobIntervalSeconds,
uploadIntentConfiguration.TemporalRootPrefix);
@@ -27,7 +27,7 @@ namespace Musify.Infrastructure.MassTransit
outbox.QueryDelay = TimeSpan.FromSeconds(1);
outbox.DuplicateDetectionWindow = TimeSpan.FromMinutes(30);
});
} );
options.UsingRabbitMq((busRegistrationContext, busFactoryConfigurator) =>
ConfigureRabbitMqHost(
@@ -61,7 +61,7 @@ namespace Musify.Infrastructure.MassTransit
outbox.QueryDelay = TimeSpan.FromSeconds(1);
outbox.DuplicateDetectionWindow = TimeSpan.FromMinutes(30);
});
} );
options.SetKebabCaseEndpointNameFormatter();
@@ -73,7 +73,7 @@ namespace Musify.Infrastructure.MassTransit
repository.ConcurrencyMode = ConcurrencyMode.Pessimistic;
repository.ExistingDbContext<Database>();
repository.UsePostgres();
});
} );
options.AddSagaStateMachine<PlayListProcessingStateMachine, PlayListProcessingState>()
.EntityFrameworkRepository(repository =>
@@ -81,13 +81,13 @@ namespace Musify.Infrastructure.MassTransit
repository.ConcurrencyMode = ConcurrencyMode.Pessimistic;
repository.ExistingDbContext<Database>();
repository.UsePostgres();
});
} );
options.AddConfigureEndpointsCallback((registrationContext, _, endpointConfigurator) =>
{
UseStandardRetry(endpointConfigurator);
endpointConfigurator.UseEntityFrameworkOutbox<Database>(registrationContext);
});
} );
options.UsingRabbitMq((busRegistrationContext, busFactoryConfigurator) =>
{
@@ -96,7 +96,7 @@ namespace Musify.Infrastructure.MassTransit
busRegistrationContext.GetRequiredService<MassTransitConfiguration>());
busFactoryConfigurator.ConfigureEndpoints(busRegistrationContext);
});
} );
} );
return serviceDescriptors;
@@ -28,7 +28,7 @@ namespace Musify.Infrastructure.MassTransit.Sagas
context.Saga.UpdatedAt = DateTime.UtcNow;
context.Saga.Bucket = context.Message.Bucket;
context.Saga.PictureKey = context.Message.PictureDestinationKey;
})
} )
.TransitionTo(Processing));
During(Processing,
@@ -33,7 +33,7 @@ namespace Musify.Infrastructure.MassTransit.Sagas
context.Saga.Bucket = context.Message.Bucket;
context.Saga.PictureKey = context.Message.PictureDestinationKey;
context.Saga.AudioKey = context.Message.AudioDestinationKey;
})
} )
.TransitionTo(Processing));
During(Processing,
@@ -42,14 +42,14 @@ namespace Musify.Infrastructure.MassTransit.Sagas
{
context.Saga.PictureProcessed = true;
context.Saga.UpdatedAt = DateTime.UtcNow;
})
} )
.If(context => context.Saga.AudioProcessed, binder => binder.Finalize()),
When(AudioProcessed)
.Then(context =>
{
context.Saga.AudioProcessed = true;
context.Saga.UpdatedAt = DateTime.UtcNow;
})
} )
.If(context => context.Saga.PictureProcessed, binder => binder.Finalize()),
When(PictureFailed)
.Then(context => context.Saga.UpdatedAt = DateTime.UtcNow)
@@ -101,7 +101,7 @@ namespace Musify.Infrastructure.Services
using var process = BuildProcess(arguments, workingDirectory, redirectStandardInput: true);
process.Start();
logger.LogDebug("[{Operation}] ffmpeg started (PID: {ProcessId}) in {WorkingDirectory}", operationName, process.Id, workingDirectory);
logger.LogDebug("[{Operation}] ffmpeg started (PID: {ProcessId} ) in {WorkingDirectory}", operationName, process.Id, workingDirectory);
var outputTask = process.StandardOutput.ReadToEndAsync(cancellationToken);
var errorTask = process.StandardError.ReadToEndAsync(cancellationToken);
@@ -124,7 +124,7 @@ namespace Musify.Infrastructure.Services
using var process = BuildProcess(arguments, workingDirectory, redirectStandardInput: false);
process.Start();
logger.LogDebug("[{Operation}] ffmpeg started (PID: {ProcessId}) in {WorkingDirectory}", operationName, process.Id, workingDirectory);
logger.LogDebug("[{Operation}] ffmpeg started (PID: {ProcessId} ) in {WorkingDirectory}", operationName, process.Id, workingDirectory);
var outputTask = process.StandardOutput.ReadToEndAsync(cancellationToken);
var errorTask = process.StandardError.ReadToEndAsync(cancellationToken);
@@ -164,7 +164,7 @@ namespace Musify.Infrastructure.Services
}
catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
{
logger.LogError("[{Operation}] ffmpeg timed out after {Timeout} (PID: {ProcessId})",
logger.LogError("[{Operation}] ffmpeg timed out after {Timeout} (PID: {ProcessId} )",
operationName, audioTranscoderConfiguration.TranscodingTimeout, process.Id);
TryKillProcess(process);
@@ -174,7 +174,7 @@ namespace Musify.Infrastructure.Services
var standardError = await errorTask;
var standardOutput = await outputTask;
logger.LogDebug("[{Operation}] ffmpeg finished (PID: {ProcessId}). Exit code: {ExitCode}, Output: {OutputLength}B, Error: {ErrorLength}B",
logger.LogDebug("[{Operation}] ffmpeg finished (PID: {ProcessId} ). Exit code: {ExitCode}, Output: {OutputLength}B, Error: {ErrorLength}B",
operationName, process.Id, process.ExitCode, standardOutput.Length, standardError.Length);
return new FfmpegExecutionResult(process.ExitCode, standardOutput, standardError);
@@ -189,7 +189,7 @@ namespace Musify.Infrastructure.Services
}
catch (Exception exception)
{
logger.LogError(exception, "Failed to kill ffmpeg process (PID: {ProcessId})", process.Id);
logger.LogError(exception, "Failed to kill ffmpeg process (PID: {ProcessId} )", process.Id);
}
}
@@ -276,7 +276,7 @@ namespace Musify.Infrastructure.Services
{
listResponse = await amazonS3.ListObjectsV2Async(listRequest, cancellationToken);
if (listResponse.S3Objects is null or { Count: 0 })
if (listResponse.S3Objects is null or { Count: 0 } )
break;
var deleteRequest = new DeleteObjectsRequest