anshdadhich commited on
Commit
0e209a3
·
verified ·
1 Parent(s): 7bb5463

Upload FastSeekWpf/Core/CacheManager.cs

Browse files
Files changed (1) hide show
  1. FastSeekWpf/Core/CacheManager.cs +8 -1
FastSeekWpf/Core/CacheManager.cs CHANGED
@@ -48,7 +48,14 @@ public static class CacheManager
48
  byte[] compressed = File.ReadAllBytes(CachePath);
49
  byte[] bytes = LZ4Pickler.Unpickle(compressed);
50
  string json = Encoding.UTF8.GetString(bytes);
51
- return JsonSerializer.Deserialize<CacheData>(json, JsonOptions);
 
 
 
 
 
 
 
52
  }
53
  catch
54
  {
 
48
  byte[] compressed = File.ReadAllBytes(CachePath);
49
  byte[] bytes = LZ4Pickler.Unpickle(compressed);
50
  string json = Encoding.UTF8.GetString(bytes);
51
+ var cache = JsonSerializer.Deserialize<CacheData>(json, JsonOptions);
52
+ // Back-compat: single DriveRoot → DriveRoots list
53
+ if (cache != null && cache.DriveRoots == null || cache!.DriveRoots.Count == 0)
54
+ {
55
+ // This is the old format — can't use it, need full rescan
56
+ return null;
57
+ }
58
+ return cache;
59
  }
60
  catch
61
  {