Renames and changes
This commit is contained in:
@@ -38,7 +38,7 @@ namespace Musify.Infrastructure.MassTransit.Activities
|
||||
|
||||
Directory.CreateDirectory(workingDirectory);
|
||||
|
||||
logger.LogDebug("Generated audio workflow paths. WorkingDirectory: {WorkingDirectory}, SourceFilePath: {SourceFilePath}",
|
||||
logger.LogDebug("Generated audio workflow paths. WorkingDirectory={WorkingDirectory}, SourceFilePath={SourceFilePath}",
|
||||
workingDirectory,
|
||||
sourceFilePath);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Musify.Infrastructure.MassTransit.Activities
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Error generating audio workflow paths for key {SourceKeyName}",
|
||||
logger.LogError(exception, "Error generating audio workflow paths for key={SourceKey}",
|
||||
executeContext.Arguments.SourceKey);
|
||||
await processTrackingStore.FailStepAsync(processId, stepId, exception.Message, executeContext.CancellationToken);
|
||||
throw;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Musify.Infrastructure.MassTransit.Activities
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
var errorMessage = string.Join("; ", result.Errors);
|
||||
logger.LogError("Transcoding failed for file {SourceFilePath}. Errors: {ErrorMessage}",
|
||||
logger.LogError("Transcoding failed for file={SourceFilePath}. Errors={ErrorMessage}",
|
||||
sourceFilePath, errorMessage);
|
||||
throw new Exception(errorMessage);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace Musify.Infrastructure.MassTransit.Activities
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Error during transcoding activity for file {SourceFilePath}",
|
||||
logger.LogError(exception, "Error during transcoding activity for file={SourceFilePath}",
|
||||
sourceFilePath);
|
||||
await processTrackingStore.FailStepAsync(processId, stepId, exception.Message, executeContext.CancellationToken);
|
||||
throw;
|
||||
@@ -74,13 +74,13 @@ namespace Musify.Infrastructure.MassTransit.Activities
|
||||
if (Directory.Exists(compensateContext.Log.WorkingDirectory))
|
||||
Directory.Delete(compensateContext.Log.WorkingDirectory, recursive: true);
|
||||
else
|
||||
logger.LogWarning("Working directory {WorkingDirectory} does not exist during compensation",
|
||||
logger.LogWarning("Working directory={WorkingDirectory} does not exist during compensation",
|
||||
compensateContext.Log.WorkingDirectory);
|
||||
return Task.FromResult(compensateContext.Compensated());
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Error compensating transcoded audio directory {WorkingDirectory}", compensateContext.Log.WorkingDirectory);
|
||||
logger.LogError(exception, "Error compensating transcoded audio directory={WorkingDirectory}", compensateContext.Log.WorkingDirectory);
|
||||
return Task.FromResult(compensateContext.Failed(exception));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,21 +39,21 @@ namespace Musify.Infrastructure.MassTransit.Activities.Audio
|
||||
|
||||
if (track is null)
|
||||
{
|
||||
logger.LogWarning("Track with id {TrackId} not found",
|
||||
logger.LogWarning("Track with id={TrackId} not found",
|
||||
executeContext.Arguments.TrackId);
|
||||
throw new InvalidOperationException($"Track with id {executeContext.Arguments.TrackId} not found");
|
||||
}
|
||||
|
||||
var log = new UpdateTrackAudioLog(
|
||||
track.Id,
|
||||
track.AudioFolderKeyName);
|
||||
track.AudioFolderName);
|
||||
|
||||
track.AudioFolderKeyName = Path.GetFileName(executeContext.Arguments.AudioFolderKey);
|
||||
track.AudioFolderName = Path.GetFileName(executeContext.Arguments.AudioFolderKey);
|
||||
|
||||
database.Tracks.Update(track);
|
||||
await database.SaveChangesAsync(executeContext.CancellationToken);
|
||||
|
||||
logger.LogInformation("Updated Track {TrackId} audio",
|
||||
logger.LogInformation("Updated Track={TrackId} audio",
|
||||
executeContext.Arguments.TrackId);
|
||||
|
||||
await processTrackingStore.CompleteStepAsync(processId, stepId, executeContext.CancellationToken);
|
||||
@@ -61,7 +61,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Audio
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Error updating Track {TrackId} audio",
|
||||
logger.LogError(exception, "Error updating Track={TrackId} audio",
|
||||
executeContext.Arguments.TrackId);
|
||||
await processTrackingStore.FailStepAsync(processId, stepId, exception.Message, executeContext.CancellationToken);
|
||||
throw;
|
||||
@@ -81,7 +81,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Audio
|
||||
return compensateContext.Compensated();
|
||||
}
|
||||
|
||||
track.AudioFolderKeyName = compensateContext.Log.PreviousFolderAudioKey;
|
||||
track.AudioFolderName = compensateContext.Log.PreviousFolderAudioKey;
|
||||
|
||||
database.Tracks.Update(track);
|
||||
await database.SaveChangesAsync(compensateContext.CancellationToken);
|
||||
@@ -90,7 +90,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Audio
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Error compensating Track {TrackId} audio", compensateContext.Log.TrackId);
|
||||
logger.LogError(exception, "Error compensating Track={TrackId} audio", compensateContext.Log.TrackId);
|
||||
return compensateContext.Failed(exception);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user