🐛 Fix dozens of issues in new drive system
This commit is contained in:
@@ -546,6 +546,7 @@ public class FileIndexController(
|
|||||||
var fileIndexes = await db.FileIndexes
|
var fileIndexes = await db.FileIndexes
|
||||||
.Where(fi => fi.AccountId == accountId)
|
.Where(fi => fi.AccountId == accountId)
|
||||||
.Include(fi => fi.File)
|
.Include(fi => fi.File)
|
||||||
|
.ThenInclude(f => f.Object)
|
||||||
.Where(fi =>
|
.Where(fi =>
|
||||||
(string.IsNullOrEmpty(path) || fi.Path == FileIndexService.NormalizePath(path)) &&
|
(string.IsNullOrEmpty(path) || fi.Path == FileIndexService.NormalizePath(path)) &&
|
||||||
(fi.File.Name.ToLower().Contains(searchTerm) ||
|
(fi.File.Name.ToLower().Contains(searchTerm) ||
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ public class FileIndexService(AppDatabase db)
|
|||||||
return await db.FileIndexes
|
return await db.FileIndexes
|
||||||
.Where(fi => fi.AccountId == accountId && fi.Path == normalizedPath)
|
.Where(fi => fi.AccountId == accountId && fi.Path == normalizedPath)
|
||||||
.Include(fi => fi.File)
|
.Include(fi => fi.File)
|
||||||
|
.ThenInclude(f => f.Object)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,6 +155,7 @@ public class FileIndexService(AppDatabase db)
|
|||||||
return await db.FileIndexes
|
return await db.FileIndexes
|
||||||
.Where(fi => fi.FileId == fileId)
|
.Where(fi => fi.FileId == fileId)
|
||||||
.Include(fi => fi.File)
|
.Include(fi => fi.File)
|
||||||
|
.ThenInclude(f => f.Object)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -156,7 +156,10 @@ public class BroadcastEventHandler(
|
|||||||
|
|
||||||
logger.LogInformation("Processing file {FileId} in background...", fileId);
|
logger.LogInformation("Processing file {FileId} in background...", fileId);
|
||||||
|
|
||||||
var fileToUpdate = await scopedDb.Files.AsNoTracking().FirstAsync(f => f.Id == fileId);
|
var fileToUpdate = await scopedDb.Files
|
||||||
|
.AsNoTracking()
|
||||||
|
.Include(f => f.Object)
|
||||||
|
.FirstAsync(f => f.Id == fileId);
|
||||||
|
|
||||||
// Find the upload task associated with this file
|
// Find the upload task associated with this file
|
||||||
var baseTask = await scopedDb.Tasks
|
var baseTask = await scopedDb.Tasks
|
||||||
|
|||||||
Reference in New Issue
Block a user