Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the source media files are not directly copied over to destina… #71

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ams/AssetMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public async Task<MigrationResult> MigrateAsync(
result.Status = transformResult.Status;
result.OutputPath = transformResult.OutputPath;

if (result.Status == MigrationStatus.Failed)
if (result.Status != MigrationStatus.Skipped)
{
break;
}
Expand Down
2 changes: 1 addition & 1 deletion ams/StorageMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private async Task<MigrationResult> MigrateAsync(
result.Status = transformResult.Status;
result.OutputPath = transformResult.OutputPath;

if (result.Status == MigrationStatus.Failed)
if (result.Status != MigrationStatus.Skipped)
{
break;
}
Expand Down
5 changes: 4 additions & 1 deletion transform/PackageTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ await Task.WhenAll(
Directory.Delete(workingDirectory, true);
}

return $"{outputPath.Prefix}{Path.GetFileNameWithoutExtension(manifest.FileName)}";
// Mark the output container appropriately so that it won't be used as an input asset in new run.
await UpdateOutputStatus(outputPath.Container, cancellationToken);

return outputPath.Prefix;
}

private UploadPipe CreateUpload(string filePath, UploadHelper helper)
Expand Down
16 changes: 10 additions & 6 deletions transform/StorageTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ public async Task<AssetMigrationResult> RunAsync(
var result = new AssetMigrationResult();

_logger.LogTrace("Asset {asset} is in format: {format}.", details.AssetName, details.Manifest?.Format);
if (details.Manifest != null && details.Manifest.IsLive)
{
_logger.LogWarning("Skipping asset {asset} which is from a running live event. Rerun the migration after the live event is stopped.", details.AssetName);
result.Status = MigrationStatus.Skipped;
return result;
}

if (IsSupported(details))
{
Expand All @@ -62,6 +56,16 @@ public async Task<AssetMigrationResult> RunAsync(
result.Status = MigrationStatus.Failed;
}
}
else
{
var format = details.Manifest != null ? details.Manifest.Format : "non_ism";
_logger.LogInformation("The asset {asset} with format {format} is not supported by transform {transform} in current version, try next transform...",
details.AssetName,
format,
this.GetType().Name);

result.Status = MigrationStatus.Skipped;
}

return result;
}
Expand Down