Skip to content

Commit

Permalink
mostly cosmetics changes, fixed one build warning in CleanUpAssetAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
pohhsu committed Aug 2, 2023
1 parent f6fe34e commit 26ca3c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
3 changes: 1 addition & 2 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AMSMigrate.ams;
using AMSMigrate.Ams;
using AMSMigrate.Ams;
using AMSMigrate.Azure;
using AMSMigrate.Contracts;
using AMSMigrate.Local;
Expand Down
29 changes: 14 additions & 15 deletions ams/CleanupCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Spectre.Console;
using System.ComponentModel;

namespace AMSMigrate.ams
namespace AMSMigrate.Ams
{
internal class CleanupCommand : BaseMigrator
{
Expand Down Expand Up @@ -166,20 +166,19 @@ private async Task<bool> CleanUpAssetAsync(bool isForcedelete,MediaServicesAccou
// The asset container exists, try to check the metadata list first.

if (isForcedelete||(_tracker.GetMigrationStatusAsync(container, cancellationToken).Result.Status == MigrationStatus.Completed))
{

var locator = await account.GetStreamingLocatorAsync(asset, cancellationToken);
if (locator != null)
{
await locator.DeleteAsync(WaitUntil.Completed);
}

if (asset != null)
{
await asset.DeleteAsync(WaitUntil.Completed);
}
await container.DeleteAsync();
_logger.LogDebug("locator: {locator}, Migrated asset: {asset} , container: {container} are deleted.", locator?.Data.Name, asset.Data.Name, container?.Name);
{
var locator = await account.GetStreamingLocatorAsync(asset, cancellationToken);
if (locator != null)
{
await locator.DeleteAsync(WaitUntil.Completed);
}

if (asset != null)
{
await asset.DeleteAsync(WaitUntil.Completed);
}
await container.DeleteAsync();
_logger.LogDebug("locator: {locator}, Migrated asset: {asset} , container: {container} are deleted.", locator?.Data.Name, asset?.Data.Name, container?.Name);
return true;
}
else
Expand Down
2 changes: 1 addition & 1 deletion transform/StorageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public static async Task<AssetDetails> GetDetailsAsync(

if (asset.Data.StorageEncryptionFormat != MediaAssetStorageEncryptionFormat.None)
{
// The asset is encypted with its own key and list of IVs.
// The asset is encrypted with its own key and list of IVs.
decryptInfo = await asset.GetEncryptionKeyAsync(cancellationToken);
}

Expand Down

0 comments on commit 26ca3c7

Please sign in to comment.