🗑️ Clean up the cloud file table unused fields

This commit is contained in:
2026-01-11 23:58:37 +08:00
parent de1175bdc7
commit 6d5303f99c
9 changed files with 26 additions and 11 deletions

View File

@@ -42,9 +42,11 @@ public class UsageService(AppDatabase db)
PoolName = p.Name,
UsageBytes = fileQuery
.Where(f => f.PoolId == p.Id)
.Include(f => f.Object)
.Sum(f => f.Size),
Cost = fileQuery
.Where(f => f.PoolId == p.Id)
.Include(f => f.Object)
.Sum(f => f.Size) / 1024.0 / 1024.0 *
(p.BillingConfig.CostMultiplier ?? 1.0),
FileCount = fileQuery
@@ -80,6 +82,7 @@ public class UsageService(AppDatabase db)
.AsQueryable();
var usageBytes = await fileQuery
.Include(f => f.Object)
.SumAsync(f => f.Size);
var fileCount = await fileQuery
@@ -106,6 +109,7 @@ public class UsageService(AppDatabase db)
.Where(f => f.PoolId.HasValue)
.Where(f => !f.IsMarkedRecycle)
.Include(f => f.Pool)
.Include(f => f.Object)
.Where(f => !f.ExpiredAt.HasValue || f.ExpiredAt > now)
.Select(f => new
{