mirror of
https://github.com/immich-app/immich.git
synced 2026-04-28 04:03:12 -07:00
refactor
This commit is contained in:
@@ -183,8 +183,10 @@ class RemoteAlbumService {
|
||||
return album.added.length;
|
||||
}
|
||||
|
||||
/// Adds an asset selection to an album, uploading any local-only assets
|
||||
/// first and linking each one as soon as its upload completes.
|
||||
/// !TODO The name here is not clear as we have addAssets method above,
|
||||
/// which is only add remote assets to album, for the next PR, we will allow
|
||||
/// adding local assets from album from the timeline as well with this flow.
|
||||
/// So saving that for the next refactor
|
||||
Future<int> addAssetsToAlbum({
|
||||
required String albumId,
|
||||
required UserDto uploader,
|
||||
|
||||
@@ -39,7 +39,8 @@ class _RemoteAlbumPageState extends ConsumerState<RemoteAlbumPage> {
|
||||
}
|
||||
|
||||
Future<void> addAssets(BuildContext context) async {
|
||||
final albumAssets = await ref.read(remoteAlbumProvider.notifier).getAssets(_album.id);
|
||||
final notifier = ref.read(remoteAlbumProvider.notifier);
|
||||
final albumAssets = await notifier.getAssets(_album.id);
|
||||
|
||||
final newAssets = await context.pushRoute<Set<BaseAsset>>(
|
||||
DriftAssetSelectionTimelineRoute(lockedSelectionAssets: albumAssets.toSet()),
|
||||
@@ -49,7 +50,7 @@ class _RemoteAlbumPageState extends ConsumerState<RemoteAlbumPage> {
|
||||
return;
|
||||
}
|
||||
|
||||
final added = await ref.read(remoteAlbumProvider.notifier).addAssetsToAlbum(_album.id, newAssets);
|
||||
final added = await notifier.addAssetsToAlbum(_album.id, newAssets);
|
||||
|
||||
if (added > 0 && context.mounted) {
|
||||
ImmichToast.show(
|
||||
|
||||
Reference in New Issue
Block a user