From 2291e3b158348473a700e83ac4e78c0ab6f09147 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Sun, 23 Apr 2023 01:37:39 +0800 Subject: [PATCH] Fix outdated albums not getting updated to cache correctly --- app/lib/entity/album/repo2.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/lib/entity/album/repo2.dart b/app/lib/entity/album/repo2.dart index 2069489b..27fefebd 100644 --- a/app/lib/entity/album/repo2.dart +++ b/app/lib/entity/album/repo2.dart @@ -92,7 +92,9 @@ class CachedAlbumRepo2 implements AlbumRepo2 { // query remote final outdated = [ ...failed, - ...cachedGroup[false]?.map((e) => e.albumFile!) ?? const [], + ...cachedGroup[false]?.map((e) => + albumFiles.firstWhere(e.albumFile!.compareServerIdentity)) ?? + const [], ]; final remote = await remoteDataSrc.getAlbums(account, outdated, onError: onError);