mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor
This commit is contained in:
@@ -183,8 +183,10 @@ class RemoteAlbumService {
|
|||||||
return album.added.length;
|
return album.added.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds an asset selection to an album, uploading any local-only assets
|
/// !TODO The name here is not clear as we have addAssets method above,
|
||||||
/// first and linking each one as soon as its upload completes.
|
/// 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({
|
Future<int> addAssetsToAlbum({
|
||||||
required String albumId,
|
required String albumId,
|
||||||
required UserDto uploader,
|
required UserDto uploader,
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ class _RemoteAlbumPageState extends ConsumerState<RemoteAlbumPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> addAssets(BuildContext context) async {
|
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>>(
|
final newAssets = await context.pushRoute<Set<BaseAsset>>(
|
||||||
DriftAssetSelectionTimelineRoute(lockedSelectionAssets: albumAssets.toSet()),
|
DriftAssetSelectionTimelineRoute(lockedSelectionAssets: albumAssets.toSet()),
|
||||||
@@ -49,7 +50,7 @@ class _RemoteAlbumPageState extends ConsumerState<RemoteAlbumPage> {
|
|||||||
return;
|
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) {
|
if (added > 0 && context.mounted) {
|
||||||
ImmichToast.show(
|
ImmichToast.show(
|
||||||
|
|||||||
Reference in New Issue
Block a user