Upload FastSeekWpf/Core/CacheManager.cs
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
{
|