Fix renamed files removed from db

This commit is contained in:
Ming Ming 2022-02-08 19:48:24 +08:00
parent fedfc4b01c
commit 82f43b1370

View file

@ -578,8 +578,9 @@ class FileCachedDataSource implements FileDataSource {
/// Remove extra entries from local cache based on remote results
Future<void> _cleanUpCacheWithRemote(
Account account, List<File> remote, List<File> cache) async {
final removed =
cache.where((c) => !remote.any((r) => r.path == c.path)).toList();
final removed = cache
.where((c) => !remote.any((r) => r.compareServerIdentity(c)))
.toList();
if (removed.isEmpty) {
return;
}