🗑️ Clean up the cloud file table unused fields
This commit is contained in:
@@ -303,6 +303,7 @@ public class FileController(
|
||||
.Where(e => e.IsMarkedRecycle == recycled)
|
||||
.Where(e => e.AccountId == accountId)
|
||||
.Include(e => e.Pool)
|
||||
.Include(e => e.Object)
|
||||
.AsQueryable();
|
||||
|
||||
if (pool.HasValue) filesQuery = filesQuery.Where(e => e.PoolId == pool);
|
||||
|
||||
@@ -64,7 +64,10 @@ public class FileUploadController(
|
||||
var accountId = Guid.Parse(currentUser.Id);
|
||||
|
||||
// Check if a file with the same hash already exists
|
||||
var existingFile = await db.Files.FirstOrDefaultAsync(f => f.Hash == request.Hash);
|
||||
var existingFile = await db.Files
|
||||
.Include(f => f.Object)
|
||||
.Where(f => f.Object != null && f.Object.Hash == request.Hash)
|
||||
.FirstOrDefaultAsync();
|
||||
if (existingFile != null)
|
||||
{
|
||||
// Create the file index if a path is provided, even for existing files
|
||||
|
||||
Reference in New Issue
Block a user