chore(mobile): Revert "remove exclude album mechanism for backup (#10552)" (#10686)

Revert "chore(mobile): remove exclude album mechanism for backup (#10552)"

This reverts commit 5f47cf604a.
This commit is contained in:
Alex 2024-06-29 11:30:18 -05:00 committed by GitHub
parent 8f553ddb39
commit 887acb9d9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 309 additions and 32 deletions

View file

@ -29,7 +29,7 @@ class BackupControllerPage extends HookConsumerWidget {
final didGetBackupInfo = useState(false);
bool hasExclusiveAccess =
backupState.backupProgress != BackUpProgressEnum.inBackground;
bool shouldBackup = backupState.backupCandidates.length -
bool shouldBackup = backupState.allUniqueAssets.length -
backupState.selectedAlbumsBackupAssetsIds.length ==
0 ||
!hasExclusiveAccess
@ -100,6 +100,29 @@ class BackupControllerPage extends HookConsumerWidget {
}
}
Widget buildExcludedAlbumName() {
var text = "backup_controller_page_excluded".tr();
var albums = ref.watch(backupProvider).excludedBackupAlbums;
if (albums.isNotEmpty) {
for (var album in albums) {
text += "${album.name}, ";
}
return Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
text.trim().substring(0, text.length - 2),
style: context.textTheme.labelLarge?.copyWith(
color: Colors.red[300],
),
),
);
} else {
return const SizedBox();
}
}
buildFolderSelectionTile() {
return Padding(
padding: const EdgeInsets.only(top: 8.0),
@ -131,6 +154,7 @@ class BackupControllerPage extends HookConsumerWidget {
style: context.textTheme.bodyMedium,
).tr(),
buildSelectedAlbumName(),
buildExcludedAlbumName(),
],
),
),
@ -268,7 +292,7 @@ class BackupControllerPage extends HookConsumerWidget {
subtitle: "backup_controller_page_total_sub".tr(),
info: ref.watch(backupProvider).availableAlbums.isEmpty
? "..."
: "${backupState.backupCandidates.length}",
: "${backupState.allUniqueAssets.length}",
),
BackupInfoCard(
title: "backup_controller_page_backup".tr(),
@ -282,7 +306,7 @@ class BackupControllerPage extends HookConsumerWidget {
subtitle: "backup_controller_page_remainder_sub".tr(),
info: ref.watch(backupProvider).availableAlbums.isEmpty
? "..."
: "${max(0, backupState.backupCandidates.length - backupState.selectedAlbumsBackupAssetsIds.length)}",
: "${max(0, backupState.allUniqueAssets.length - backupState.selectedAlbumsBackupAssetsIds.length)}",
),
const Divider(),
const CurrentUploadingAssetInfoBox(),