mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 14:56:20 +01:00
Fix unnecessarily updating album with same cover for diff user
This commit is contained in:
parent
e58d28ee57
commit
8d017f6042
1 changed files with 5 additions and 2 deletions
|
@ -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/cover_provider.dart';
|
||||||
import 'package:nc_photos/entity/album/item.dart';
|
import 'package:nc_photos/entity/album/item.dart';
|
||||||
import 'package:nc_photos/entity/album/sort_provider.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;
|
import 'package:nc_photos/entity/file_util.dart' as file_util;
|
||||||
|
|
||||||
class UpdateAutoAlbumCover {
|
class UpdateAutoAlbumCover {
|
||||||
|
@ -47,8 +48,10 @@ class UpdateAutoAlbumCover {
|
||||||
.where((element) => file_util.isSupportedFormat(element))
|
.where((element) => file_util.isSupportedFormat(element))
|
||||||
.firstWhere((element) => element.hasPreview ?? false);
|
.firstWhere((element) => element.hasPreview ?? false);
|
||||||
// cache the result for later use
|
// cache the result for later use
|
||||||
if (coverFile.path !=
|
if ((album.coverProvider as AlbumAutoCoverProvider)
|
||||||
(album.coverProvider as AlbumAutoCoverProvider).coverFile?.path) {
|
.coverFile
|
||||||
|
?.compareServerIdentity(coverFile) !=
|
||||||
|
true) {
|
||||||
return album.copyWith(
|
return album.copyWith(
|
||||||
coverProvider: AlbumAutoCoverProvider(
|
coverProvider: AlbumAutoCoverProvider(
|
||||||
coverFile: coverFile,
|
coverFile: coverFile,
|
||||||
|
|
Loading…
Reference in a new issue