anshdadhich commited on
Commit
a5b97dd
·
verified ·
1 Parent(s): 8cd2e75

Upload FastSeekWpf/MainWindow.xaml.cs

Browse files
Files changed (1) hide show
  1. FastSeekWpf/MainWindow.xaml.cs +3 -21
FastSeekWpf/MainWindow.xaml.cs CHANGED
@@ -193,27 +193,9 @@ public partial class MainWindow : Window, INotifyPropertyChanged
193
  Dispatcher.Invoke(() => StatusText.Text = $"Scanning {drive.Letter}: ...");
194
 
195
  using var reader = new MftReader(drive);
196
- ScanResult? scan = null;
197
- string method = "direct";
198
 
199
- // Try direct first (matches Rust scan_direct())
200
- scan = reader.ScanDirect();
201
- if (scan != null)
202
- {
203
- Logger.Log($"Direct scan OK for {drive.Letter}");
204
- }
205
- else
206
- {
207
- Logger.Log($"Direct scan unavailable for {drive.Letter}, trying fallback");
208
- scan = reader.Scan();
209
- if (scan != null)
210
- {
211
- method = "fallback";
212
- Logger.Log($"Fallback scan OK for {drive.Letter}");
213
- }
214
- }
215
-
216
- if (scan != null && scan.Records.Count > 0)
217
  {
218
  _index.PopulateFromScan(scan, drive.Root);
219
  totalRecords += scan.Records.Count;
@@ -260,7 +242,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged
260
  {
261
  if (_index.Count == 0)
262
  {
263
- EmptyHint.Text = "Index is empty.\nRun CLI diagnostics:\nFastSeekWpf.exe --cli";
264
  StatusText.Text = "0 files indexed — check diagnostics";
265
  }
266
  else
 
193
  Dispatcher.Invoke(() => StatusText.Text = $"Scanning {drive.Letter}: ...");
194
 
195
  using var reader = new MftReader(drive);
196
+ var (scan, method) = reader.ScanAny();
 
197
 
198
+ if (scan.Records.Count > 0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  {
200
  _index.PopulateFromScan(scan, drive.Root);
201
  totalRecords += scan.Records.Count;
 
242
  {
243
  if (_index.Count == 0)
244
  {
245
+ EmptyHint.Text = "Index is empty.\nRun CLI diagnostics: FastSeekWpf.exe --cli";
246
  StatusText.Text = "0 files indexed — check diagnostics";
247
  }
248
  else