From 8d017f60420787518b351c5afd4de5407ac14ee3 Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Sun, 28 Nov 2021 21:09:14 +0800 Subject: [PATCH] Fix unnecessarily updating album with same cover for diff user --- lib/use_case/update_auto_album_cover.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/use_case/update_auto_album_cover.dart b/lib/use_case/update_auto_album_cover.dart index 808e8e9f..593b7e6d 100644 --- a/lib/use_case/update_auto_album_cover.dart +++ b/lib/use_case/update_auto_album_cover.dart @@ -2,6 +2,7 @@ import 'package:nc_photos/entity/album.dart'; import 'package:nc_photos/entity/album/cover_provider.dart'; import 'package:nc_photos/entity/album/item.dart'; import 'package:nc_photos/entity/album/sort_provider.dart'; +import 'package:nc_photos/entity/file.dart'; import 'package:nc_photos/entity/file_util.dart' as file_util; class UpdateAutoAlbumCover { @@ -47,8 +48,10 @@ class UpdateAutoAlbumCover { .where((element) => file_util.isSupportedFormat(element)) .firstWhere((element) => element.hasPreview ?? false); // cache the result for later use - if (coverFile.path != - (album.coverProvider as AlbumAutoCoverProvider).coverFile?.path) { + if ((album.coverProvider as AlbumAutoCoverProvider) + .coverFile + ?.compareServerIdentity(coverFile) != + true) { return album.copyWith( coverProvider: AlbumAutoCoverProvider( coverFile: coverFile,