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

cosmetic changes only #183

Merged
merged 1 commit into from
Sep 18, 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/AccountMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public AccountMigrator(
string accountName,
IAnsiConsole console,
ILogger<AccountMigrator> logger,
TokenCredential credential) :
TokenCredential credential) :
base(options, console, credential)
{
_accountName = accountName;
Expand Down
2 changes: 1 addition & 1 deletion ams/AssetMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override async Task MigrateAsync(CancellationToken cancellationToken)
_options.CreationTimeEnd);

var orderBy = "properties/created";

await _resourceProvider.SetStorageResourceGroupsAsync(account, cancellationToken);
var assets = account.GetMediaAssets().GetAllAsync(resourceFilter, orderby: orderBy, cancellationToken: cancellationToken);

Expand Down
7 changes: 3 additions & 4 deletions ams/AzureResourceProvider.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using AMSMigrate.Contracts;
using AMSMigrate.Contracts;
using Azure.Core;
using Azure.ResourceManager;
using Azure.ResourceManager.Media;
Expand Down Expand Up @@ -43,7 +42,7 @@ public async Task SetStorageResourceGroupsAsync(MediaServicesAccountResource acc

foreach (var storageAccount in storageAccounts)
{
var storageAccountId = storageAccount.Id;
var storageAccountId = storageAccount.Id;
var resourceGroupId = ResourceGroupResource.CreateResourceIdentifier(
storageAccountId.SubscriptionId!,
storageAccountId.ResourceGroupName!);
Expand All @@ -59,7 +58,7 @@ public async Task<MediaServicesAccountResource> GetMediaAccountAsync(
{
return await _resourceGroup.GetMediaServicesAccountAsync(
mediaAccountName, cancellationToken);
}
}

public async Task<BlobServiceClient> GetStorageAccountAsync(
MediaServicesAccountResource account,
Expand Down
6 changes: 3 additions & 3 deletions azure/AzureProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ internal class AzureProvider : ICloudProvider

public AzureProvider(
ILoggerFactory loggerFactory,
TokenCredential credentials)
TokenCredential credentials)
{
_credentials = credentials;
_loggerFactory = loggerFactory;
}

public IFileUploader GetStorageProvider(MigratorOptions migratorOptions)
public IFileUploader GetStorageProvider(MigratorOptions migratorOptions)
=> new AzureStorageUploader(migratorOptions, _credentials, _loggerFactory.CreateLogger<AzureStorageUploader>());

public ISecretUploader GetSecretProvider(KeyVaultOptions keyOptions)
public ISecretUploader GetSecretProvider(KeyVaultOptions keyOptions)
=> new KeyVaultUploader(keyOptions, _credentials, _loggerFactory.CreateLogger<KeyVaultUploader>());
}
}
22 changes: 10 additions & 12 deletions fmp4/Box.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@


using System.Globalization;
using System.Globalization;
using System.Text;
using System.Diagnostics;
using System.Net;
Expand Down Expand Up @@ -69,7 +67,7 @@ protected Box(UInt32 boxtype) :
/// </summary>
/// <param name="extendedType">The extended type.</param>
protected Box(Guid extendedType)
:this(MP4BoxType.uuid, extendedType)
: this(MP4BoxType.uuid, extendedType)
{
}

Expand Down Expand Up @@ -119,7 +117,7 @@ protected Box(Box other)
Type = other.Type;
ExtendedType = other.ExtendedType;
Size = other.Size;

Body = other.Body;
BodyInitialOffset = other.BodyInitialOffset;
BodyPreBytes = other.BodyPreBytes;
Expand All @@ -128,7 +126,7 @@ protected Box(Box other)
{
//mark begin of deserialization.
_deserializing = true;

ReadBody();
ConsumeBody();

Expand Down Expand Up @@ -392,7 +390,7 @@ public virtual bool Dirty
_dirty = value;

Size.Dirty = value;

foreach (Box child in _children)
{
child.Dirty = value;
Expand All @@ -411,7 +409,7 @@ protected void SetDirty()
/// <summary>
/// This variable tracks miscellaneous sources of dirtiness from direct members of this class,
/// </summary>
private bool _dirty;
private bool _dirty;

/// <summary>
/// This variable indicate we are currently deserializing the box.
Expand Down Expand Up @@ -554,7 +552,7 @@ private void ConsumeBody()
public virtual UInt64 ComputeSize()
{
UInt64 size = ComputeLocalSize();

foreach (Box child in _children)
{
size += child.ComputeSize();
Expand Down Expand Up @@ -760,7 +758,7 @@ public TChildBoxType GetExactlyOneChildBox<TChildBoxType>() where TChildBoxType
{
// Perform a reverse dictionary lookup to find the name of this child box
string childBoxName;
IEnumerable<KeyValuePair<UInt32,Type>> compactBoxTypes = MP4BoxType.CompactType.Where(entry => entry.Value == typeof(TChildBoxType));
IEnumerable<KeyValuePair<UInt32, Type>> compactBoxTypes = MP4BoxType.CompactType.Where(entry => entry.Value == typeof(TChildBoxType));
if (1 != compactBoxTypes.Count())
{
// We don't want to throw an exception, as we are already in the middle of throwing one, so just use class name
Expand All @@ -776,7 +774,7 @@ public TChildBoxType GetExactlyOneChildBox<TChildBoxType>() where TChildBoxType
GetType().Name, childBoxName, numBoxes));
}

return (TChildBoxType) boxes.Single();
return (TChildBoxType)boxes.Single();
}

/// <summary>
Expand Down Expand Up @@ -886,7 +884,7 @@ public virtual bool Equals(Box? other)
// Same length. Compare the contents of the streams. Ignore different starting points, that is simply state.
long thisPosition = Body.BaseStream.Position;
long thatPosition = other.Body.BaseStream.Position;

// Rewind streams
Body.BaseStream.Position = 0;
other.Body.BaseStream.Position = 0;
Expand Down
3 changes: 1 addition & 2 deletions fmp4/BoxExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Text;
using System.Text;

namespace AMSMigrate.Fmp4
{
Expand Down
9 changes: 4 additions & 5 deletions fmp4/Fmp4Fragment.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;

namespace AMSMigrate.Fmp4
{
Expand Down Expand Up @@ -114,7 +113,7 @@ private void ResetDataOffset()
// It may take more than one try to set data offset, because overwriting the
// previous values may cause a change in box sizes (see UT's - they exercise this).
int i = 0;
for ( ; i < _maxTries; i++)
for (; i < _maxTries; i++)
{
// Server/ChannelSink and Dash operate counter to Smooth Spec v6.0
// which states that tfhd/base_data_offset is relative to mdat and
Expand Down Expand Up @@ -155,7 +154,7 @@ public void WriteTo(MP4Writer writer, bool setSampleDefaults = true)
{
SetSampleDefaults();
}

ResetDataOffset();
Header.WriteTo(writer);
Data.WriteTo(writer);
Expand Down Expand Up @@ -554,7 +553,7 @@ public IEnumerable<Fmp4FragmentSample> Samples
}
}
}

#region equality methods

/// <summary>
Expand Down
8 changes: 3 additions & 5 deletions fmp4/Fmp4FragmentSample.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@


namespace AMSMigrate.Fmp4
namespace AMSMigrate.Fmp4
{
/// <summary>
/// The data needed to interpret a sample in Fmp4Fragment are scattered across a number of boxes.
Expand Down Expand Up @@ -41,8 +39,8 @@ public Fmp4FragmentSample(tfhdBox tfhd, trunEntry trunEntry, byte[]? sampleData,
_sdtpEntry = sdtpEntry;

if (sampleData != null)
{
_arraySegment = new ArraySegment<byte>(sampleData, offset, (int)Size);
{
_arraySegment = new ArraySegment<byte>(sampleData, offset, (int)Size);
}
}

Expand Down
5 changes: 2 additions & 3 deletions fmp4/Fmp4FragmentSampleExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

namespace AMSMigrate.Fmp4
namespace AMSMigrate.Fmp4
{
/// <summary>
/// Extensions for handling Fmp4FragmentSample enumerations.
Expand Down Expand Up @@ -97,7 +96,7 @@ public static IEnumerable<Fmp4FragmentSample> ModifyLastSample(this IEnumerable<
{
throw new ArgumentNullException(nameof(samples));
}

if (null == modifyLastSample)
{
throw new ArgumentNullException(nameof(modifyLastSample));
Expand Down
3 changes: 1 addition & 2 deletions fmp4/FullBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Globalization;
using System.Globalization;
using System.Diagnostics;

namespace AMSMigrate.Fmp4
Expand Down
3 changes: 1 addition & 2 deletions fmp4/MP4BoxFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;

Expand Down
5 changes: 2 additions & 3 deletions fmp4/MP4BoxType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Globalization;
using System.Globalization;

namespace AMSMigrate.Fmp4
{
Expand Down Expand Up @@ -46,7 +45,7 @@ public static class MP4BoxType
//===================================================================
// Registered Box Objects (Compact Type)
//===================================================================
private static Dictionary<UInt32,Type> _compactType = new Dictionary<UInt32,Type>()
private static Dictionary<UInt32, Type> _compactType = new Dictionary<UInt32, Type>()
{
{ moof, typeof(moofBox) },
{ mfhd, typeof(mfhdBox) },
Expand Down
5 changes: 2 additions & 3 deletions fmp4/MP4DeserializeException.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Globalization;
using System.Globalization;
using System.Runtime.Serialization;

namespace AMSMigrate.Fmp4
Expand Down Expand Up @@ -33,7 +32,7 @@ public MP4DeserializeException(string message, Exception ex)
: base(message, ex)
{
}

/// <summary>
/// Creates an MP4DeserializeException.
///
Expand Down
3 changes: 1 addition & 2 deletions fmp4/MP4Reader.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Net;
using System.Net;
using System.Text;

namespace AMSMigrate.Fmp4
Expand Down
3 changes: 1 addition & 2 deletions fmp4/MP4Writer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;
using System.Net;
using System.Text;

Expand Down
3 changes: 1 addition & 2 deletions fmp4/VariableLengthField.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;

Expand Down
3 changes: 1 addition & 2 deletions fmp4/hdlrBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Globalization;
using System.Globalization;
using System.Diagnostics;
using System.Text;

Expand Down
5 changes: 2 additions & 3 deletions fmp4/mdatBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;
using System.Security.Cryptography;

namespace AMSMigrate.Fmp4
Expand Down Expand Up @@ -214,7 +213,7 @@ public override bool Dirty
// If we reached this stage, we are not dirty
return false;
}

set
{
base.Dirty = value;
Expand Down
3 changes: 1 addition & 2 deletions fmp4/mdhdBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;
using System.Globalization;

namespace AMSMigrate.Fmp4
Expand Down
3 changes: 1 addition & 2 deletions fmp4/mdiaBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;

namespace AMSMigrate.Fmp4
{
Expand Down
7 changes: 3 additions & 4 deletions fmp4/mfhdBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;
using System.Globalization;

namespace AMSMigrate.Fmp4
Expand All @@ -14,7 +13,7 @@ public class mfhdBox : FullBox, IEquatable<mfhdBox>
/// </summary>
/// <param name="sequenceNumber">The sequence number of the fragment.</param>
public mfhdBox(UInt32 sequenceNumber) :
base(version:0, flags:0, boxtype:MP4BoxType.mfhd)
base(version: 0, flags: 0, boxtype: MP4BoxType.mfhd)
{
SequenceNumber = sequenceNumber;
Size.Value = ComputeSize();
Expand All @@ -24,7 +23,7 @@ public mfhdBox(UInt32 sequenceNumber) :
/// Copy constructor
/// </summary>
/// <param name="box">the box to copy from</param>
public mfhdBox(Box box):
public mfhdBox(Box box) :
base(box)
{
Debug.Assert(box.Type == MP4BoxType.mfhd);
Expand Down
5 changes: 2 additions & 3 deletions fmp4/moofBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;

namespace AMSMigrate.Fmp4
{
Expand All @@ -24,7 +23,7 @@ public moofBox() :
/// Deserializing/copy constructor.
/// </summary>
/// <param name="box">the box to construct from</param>
public moofBox(Box box):
public moofBox(Box box) :
base(box)
{
Debug.Assert(box.Type == MP4BoxType.moof);
Expand Down
5 changes: 2 additions & 3 deletions fmp4/moovBox.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using System.Diagnostics;
using System.Diagnostics;

namespace AMSMigrate.Fmp4
{
Expand All @@ -20,7 +19,7 @@ public moovBox() :
/// Deserializing/copy constructor.
/// </summary>
/// <param name="box">the box to construct from</param>
public moovBox(Box box):
public moovBox(Box box) :
base(box)
{
Debug.Assert(box.Type == MP4BoxType.moov);
Expand Down
Loading
Loading