From c164f70848ab0624d7755c470d5782c07553b599 Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Fri, 6 Sep 2024 10:47:26 +0200 Subject: [PATCH] add rawsize into download file dto, surely nothing will go wrong --- .../Controllers/ServerFilesController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs b/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs index efb885d..9cb3801 100644 --- a/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs +++ b/MareSynchronosServer/MareSynchronosStaticFilesServer/Controllers/ServerFilesController.cs @@ -78,7 +78,7 @@ public class ServerFilesController : ControllerBase Where(f => hashes.Contains(f.Hash)).ToListAsync().ConfigureAwait(false); List response = new(); - var cacheFile = await _mareDbContext.Files.AsNoTracking().Where(f => hashes.Contains(f.Hash)).AsNoTracking().Select(k => new { k.Hash, k.Size }).AsNoTracking().ToListAsync().ConfigureAwait(false); + var cacheFile = await _mareDbContext.Files.AsNoTracking().Where(f => hashes.Contains(f.Hash)).AsNoTracking().Select(k => new { k.Hash, k.Size, k.RawSize }).AsNoTracking().ToListAsync().ConfigureAwait(false); var allFileShards = new List(_configuration.GetValueOrDefault(nameof(StaticFilesServerConfiguration.CdnShardConfiguration), new List())); @@ -118,6 +118,7 @@ public class ServerFilesController : ControllerBase Hash = file.Hash, Size = file.Size, Url = baseUrl?.ToString() ?? string.Empty, + RawSize = file.RawSize }); }