Changes
This commit is contained in:
@@ -57,9 +57,7 @@ namespace Musify.Infrastructure.Messaging.Activities
|
||||
|
||||
var destinationDirectory = Path.GetDirectoryName(destinationPath);
|
||||
if (!string.IsNullOrWhiteSpace(destinationDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(destinationDirectory);
|
||||
}
|
||||
|
||||
using var fileStream = getFile.Value;
|
||||
if (fileStream.CanSeek)
|
||||
@@ -83,11 +81,7 @@ namespace Musify.Infrastructure.Messaging.Activities
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(compensateContext.Log.DestinationFilePath))
|
||||
{
|
||||
File.Delete(compensateContext.Log.DestinationFilePath);
|
||||
}
|
||||
|
||||
File.Delete(compensateContext.Log.DestinationFilePath);
|
||||
return Task.FromResult(compensateContext.Compensated());
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
||||
@@ -33,21 +33,15 @@ namespace Musify.Infrastructure.Messaging.Activities
|
||||
|
||||
var folderPath = executeContext.GetVariable<string>(executeContext.Arguments.SourceDirectoryVariableName);
|
||||
if (string.IsNullOrWhiteSpace(folderPath))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
$"Transfer activity requires variable '{executeContext.Arguments.SourceDirectoryVariableName}' with source directory path.");
|
||||
}
|
||||
|
||||
var destinationKeyName = executeContext.Arguments.DestinationKeyName;
|
||||
if (string.IsNullOrWhiteSpace(destinationKeyName) && !string.IsNullOrWhiteSpace(executeContext.Arguments.DestinationKeyNameVariableName))
|
||||
{
|
||||
destinationKeyName = executeContext.GetVariable<string>(executeContext.Arguments.DestinationKeyNameVariableName);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(destinationKeyName))
|
||||
{
|
||||
throw new InvalidOperationException("Transfer activity requires a destination key name from arguments or variables.");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user