Skip to content

High performance self-hosted photo and video management solution.

Fixed problem with Recent (isAll) album is both in exclude and include album list at the same time

Alex Tranf7dc916e80ec
diff --git a/mobile/lib/modules/backup/providers/backup.provider.dart b/mobile/lib/modules/backup/providers/backup.provider.dart
index e71a8dbfd8..bdb9eb4dd0 100644
--- a/mobile/lib/modules/backup/providers/backup.provider.dart
+++ b/mobile/lib/modules/backup/providers/backup.provider.dart
@@ -77,6 +77,8 @@ class BackupNotifier extends StateNotifier<BackUpState> {
}
void addExcludedAlbumForBackup(AssetPathEntity album) {
+ print("Excluded album: $album");
+
if (state.selectedBackupAlbums.contains(album)) {
removeAlbumForBackup(album);
}
diff --git a/mobile/lib/modules/backup/ui/album_info_card.dart b/mobile/lib/modules/backup/ui/album_info_card.dart
index 370db0c3b2..b523c713b1 100644
--- a/mobile/lib/modules/backup/ui/album_info_card.dart
+++ b/mobile/lib/modules/backup/ui/album_info_card.dart
@@ -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);