We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fb00d7 commit c07c67bCopy full SHA for c07c67b
lib/cache_manager.dart
@@ -23,14 +23,15 @@ class CustomCacheManager {
23
return;
24
}
25
26
- final allFiles = cacheDir.listSync(recursive: true).toList();
+ final allFiles =
27
+ cacheDir.listSync(recursive: true).whereType<File>().toList();
28
29
await _repo.open();
30
final cachedObjects = await _repo.getAllObjects();
31
final dbFiles = cachedObjects.map((e) => e.relativePath).toSet();
32
33
final orphanedFiles = allFiles.where((file) {
- final relativePath = file.path.split('$key/').last;
34
+ final relativePath = file.path.replaceFirst('${cacheDir.path}/', '');
35
return !dbFiles.contains(relativePath);
36
}).toList();
37
0 commit comments