Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit 20498b9

Browse files
committed
fix: make dB lookup "starts with" rather than "match" for the folder
1 parent a75d005 commit 20498b9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/AStar.Dev.File.App/ViewModels/MainWindowViewModel.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,15 @@ private void Cancel()
109109

110110
private async Task LoadScannedFilesAsync()
111111
{
112+
var root = SelectedFolderPath;
113+
// Normalise so the StartsWith check works regardless of trailing separator
114+
var prefix = root.TrimEnd(System.IO.Path.DirectorySeparatorChar,
115+
System.IO.Path.AltDirectorySeparatorChar)
116+
+ System.IO.Path.DirectorySeparatorChar;
117+
112118
await using var db = await _dbContextFactory.CreateDbContextAsync();
113119
var files = await db.ScannedFiles
114-
.Where(f => f.RootPath == SelectedFolderPath)
120+
.Where(f => f.FullPath.StartsWith(prefix))
115121
.OrderBy(f => f.FolderPath)
116122
.ThenBy(f => f.FileName)
117123
.ToListAsync();

0 commit comments

Comments
 (0)