Bläddra i källkod

返回更新文件夹大小

CrazyIter_Bin 4 år sedan
förälder
incheckning
cb52ff7fb2
1 ändrade filer med 5 tillägg och 3 borttagningar
  1. 5 3
      TEAMModelOS/Controllers/Core/BlobController.cs

+ 5 - 3
TEAMModelOS/Controllers/Core/BlobController.cs

@@ -335,14 +335,16 @@ namespace TEAMModelOS.Controllers.Core
             }
             long? useSize = blobSize + disSize;
             await _azureRedis.GetRedisClient(8).HashSetAsync($"Blob:Record", name, useSize);
-             
+            Dictionary<string, double?> catalog = new Dictionary<string, double?>();
             foreach (var x in urls) {
-                await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{name}", System.Web.HttpUtility.UrlDecode(x.url, Encoding.UTF8).Split("/")[0], x.size);
+                string u = System.Web.HttpUtility.UrlDecode(x.url, Encoding.UTF8).Split("/")[0];
+                await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Blob:Catalog:{name}", u, x.size);
+                catalog[u]= await _azureRedis.GetRedisClient(8).SortedSetScoreAsync($"Blob:Catalog:{name}", u);
             }
             var messageBlob = new ServiceBusMessage(new {id=Guid.NewGuid().ToString(), progress = "update",name=name}.ToJsonString());
             messageBlob.ApplicationProperties.Add("name", "Blob");
             await _serviceBus.GetServiceBusClient().SendMessageAsync("active-task", messageBlob);
-            return Ok(new { size=useSize });
+            return Ok(new { size=useSize, catalog });
         }
 
         private static (string, string) BlobUrlString(string sasUrl)