mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
Fixed problem with Recent (isAll) album is both in exclude and include album list at the same time
This commit is contained in:
parent
03e7a254a2
commit
f7dc916e80
@ -77,6 +77,8 @@ class BackupNotifier extends StateNotifier<BackUpState> {
|
||||
}
|
||||
|
||||
void addExcludedAlbumForBackup(AssetPathEntity album) {
|
||||
print("Excluded album: $album");
|
||||
|
||||
if (state.selectedBackupAlbums.contains(album)) {
|
||||
removeAlbumForBackup(album);
|
||||
}
|
||||
|
@ -102,10 +102,12 @@ class AlbumInfoCard extends HookConsumerWidget {
|
||||
HapticFeedback.selectionClick();
|
||||
|
||||
if (isExcluded) {
|
||||
// Remove from exclude album list
|
||||
ref
|
||||
.watch(backupProvider.notifier)
|
||||
.removeExcludedAlbumForBackup(albumInfo);
|
||||
} else {
|
||||
// Add to exclude album list
|
||||
if (ref.watch(backupProvider).selectedBackupAlbums.length == 1 &&
|
||||
ref
|
||||
.watch(backupProvider)
|
||||
@ -120,6 +122,16 @@ class AlbumInfoCard extends HookConsumerWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
if (albumInfo.id == 'isAll') {
|
||||
ImmichToast.show(
|
||||
context: context,
|
||||
msg: 'Cannot exclude album contains all assets',
|
||||
toastType: ToastType.error,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
ref
|
||||
.watch(backupProvider.notifier)
|
||||
.addExcludedAlbumForBackup(albumInfo);
|
||||
|
Loading…
Reference in New Issue
Block a user