|
@@ -45,17 +45,17 @@ namespace TEAMModelOS.SDK.DI
|
|
|
/// </summary>
|
|
|
/// <param name="prefix">篩選開頭名稱,Null代表容器總大小</param>
|
|
|
/// <returns>總大小(Bytes),如果為Null代表查無前置詞或者發生錯誤</returns>
|
|
|
- public static async Task<(long?, Dictionary<string, long?>)> GetBlobsCatalogSize(this BlobContainerClient client, string prefix = null)
|
|
|
+ public static async Task<(long?, Dictionary<string, double?>)> GetBlobsCatalogSize(this BlobContainerClient client, string prefix = null)
|
|
|
{
|
|
|
long? size = 0;
|
|
|
- Dictionary<string, long?> dict = new Dictionary<string, long?>();
|
|
|
+ Dictionary<string, double?> dict = new Dictionary<string, double?>();
|
|
|
try
|
|
|
{
|
|
|
- List<KeyValuePair<string, long?>> foderSize = new List<KeyValuePair<string, long?>>();
|
|
|
+ List<KeyValuePair<string, double?>> foderSize = new List<KeyValuePair<string, double?>>();
|
|
|
await foreach (BlobItem item in client.GetBlobsAsync(BlobTraits.None, BlobStates.None, prefix))
|
|
|
{
|
|
|
var len = item.Properties.ContentLength;
|
|
|
- foderSize.Add(new KeyValuePair<string, long?>(item.Name.Split("/")[0], len));
|
|
|
+ foderSize.Add(new KeyValuePair<string, double?>(item.Name.Split("/")[0], len));
|
|
|
size += item.Properties.ContentLength;
|
|
|
};
|
|
|
foderSize.Select(x => new { x.Key, x.Value }).GroupBy(y=>y.Key).ToList().ForEach(g=> {
|