Skip to content

Commit

Permalink
fix(mobile): allow select empty album as backup album (immich-app#9290)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextran1502 authored May 7, 2024
1 parent bbb9453 commit 7520ffd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions mobile/lib/providers/backup/backup.provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,29 @@ class BackupNotifier extends StateNotifier<BackUpState> {
final Set<AssetEntity> assetsFromExcludedAlbums = {};

for (final album in state.selectedBackupAlbums) {
final assetCount = await album.albumEntity.assetCountAsync;

if (assetCount == 0) {
continue;
}

final assets = await album.albumEntity.getAssetListRange(
start: 0,
end: await album.albumEntity.assetCountAsync,
end: assetCount,
);
assetsFromSelectedAlbums.addAll(assets);
}

for (final album in state.excludedBackupAlbums) {
final assetCount = await album.albumEntity.assetCountAsync;

if (assetCount == 0) {
continue;
}

final assets = await album.albumEntity.getAssetListRange(
start: 0,
end: await album.albumEntity.assetCountAsync,
end: assetCount,
);
assetsFromExcludedAlbums.addAll(assets);
}
Expand Down

0 comments on commit 7520ffd

Please sign in to comment.