From 065c999bd36a45479175957147432e0407a87f2e Mon Sep 17 00:00:00 2001 From: "jack.lewis" Date: Wed, 16 Aug 2023 09:23:46 +0100 Subject: [PATCH] changing line endings --- .../DLCS.Model/Storage/AssetStorageMetric.cs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/protagonist/DLCS.Model/Storage/AssetStorageMetric.cs b/src/protagonist/DLCS.Model/Storage/AssetStorageMetric.cs index b22183fb7..44678d764 100644 --- a/src/protagonist/DLCS.Model/Storage/AssetStorageMetric.cs +++ b/src/protagonist/DLCS.Model/Storage/AssetStorageMetric.cs @@ -1,23 +1,23 @@ -namespace DLCS.Model.Storage; - -public class AssetStorageMetric -{ - public CustomerStorage CustomerStorage { get; set; } - public StoragePolicy Policy { get; set; } - public long MaximumNumberOfStoredImages => Policy.MaximumNumberOfStoredImages; - public long CurrentNumberOfStoredImages => CustomerStorage.NumberOfStoredImages; - public long MaximumTotalSizeOfStoredImages => Policy.MaximumTotalSizeOfStoredImages; - public long CurrentTotalSizeStoredImages => CustomerStorage.TotalSizeOfStoredImages; - - /// - /// Check if there is allowance to store the specific number of assets. - /// - public bool CanStoreAsset(int assetCount = 1) => - CustomerStorage.NumberOfStoredImages + assetCount <= Policy.MaximumNumberOfStoredImages; - - /// - /// Check if there is allowance to store asset based on size - /// - public bool CanStoreAssetSize(long proposedNewSize, long oldFileSize) => - (CustomerStorage.TotalSizeOfStoredImages - oldFileSize) + proposedNewSize <= Policy.MaximumTotalSizeOfStoredImages; +namespace DLCS.Model.Storage; + +public class AssetStorageMetric +{ + public CustomerStorage CustomerStorage { get; set; } + public StoragePolicy Policy { get; set; } + public long MaximumNumberOfStoredImages => Policy.MaximumNumberOfStoredImages; + public long CurrentNumberOfStoredImages => CustomerStorage.NumberOfStoredImages; + public long MaximumTotalSizeOfStoredImages => Policy.MaximumTotalSizeOfStoredImages; + public long CurrentTotalSizeStoredImages => CustomerStorage.TotalSizeOfStoredImages; + + /// + /// Check if there is allowance to store the specific number of assets. + /// + public bool CanStoreAsset(int assetCount = 1) => + CustomerStorage.NumberOfStoredImages + assetCount <= Policy.MaximumNumberOfStoredImages; + + /// + /// Check if there is allowance to store asset based on size + /// + public bool CanStoreAssetSize(long proposedNewSize, long oldFileSize) => + (CustomerStorage.TotalSizeOfStoredImages - oldFileSize) + proposedNewSize <= Policy.MaximumTotalSizeOfStoredImages; } \ No newline at end of file