-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(mobile): add to album from asset viewer #23608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(mobile): add to album from asset viewer #23608
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this :). Most of this is small nitpicks so should be pretty trivial to fix!
mobile/lib/presentation/widgets/action_buttons/add_action_button.widget.dart
Outdated
Show resolved
Hide resolved
| String? _remoteIdOf(Object asset) { | ||
| if (asset is RemoteAsset) return asset.id; | ||
|
|
||
| try { | ||
| final dyn = asset as dynamic; | ||
| final rid = dyn.remoteId ?? dyn.id; | ||
| return rid is String ? rid : null; | ||
| } catch (_) { | ||
| return null; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets remove this function and just add a check for if (asset is RemoteAsset) instead of calling this function. Additionally, we should never fall back to the id of an asset as that is not related to remoteId in any way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only weird case would be viewing an asset that has been uploaded to the server but is being viewed from the local library timeline. Using hasRemote instead of checking if the asset is a RemoteAsset type has burned us in the past so I always use th "is" check :).
mobile/lib/presentation/widgets/action_buttons/add_action_button.widget.dart
Show resolved
Hide resolved
| return; | ||
| } | ||
|
|
||
| final addedCount = await ref.read(remoteAlbumProvider.notifier).addAssets(album.id, [id]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| final addedCount = await ref.read(remoteAlbumProvider.notifier).addAssets(album.id, [id]); | |
| final addedCount = await ref.read(remoteAlbumProvider.notifier).addAssets(album.id, [asset.remoteId]); |
mobile/lib/presentation/widgets/action_buttons/add_action_button.widget.dart
Show resolved
Hide resolved
mobile/lib/presentation/widgets/action_buttons/add_action_button.widget.dart
Show resolved
Hide resolved
mobile/lib/presentation/widgets/action_buttons/add_action_button.widget.dart
Show resolved
Hide resolved
mobile/lib/presentation/widgets/action_buttons/add_action_button.widget.dart
Show resolved
Hide resolved
mobile/lib/presentation/widgets/action_buttons/add_action_button.widget.dart
Show resolved
Hide resolved
…archiving, and moving to locked folders
…on.widget.dart Co-authored-by: Brandon Wees <[email protected]>
….dart Co-authored-by: Brandon Wees <[email protected]>
20cbe81 to
2a001ad
Compare
Description
Feature Request: #23266
Added an "add" button at the bottom of the photo-viewer, with a toast menu: "Album", "Archive", "Locked Folder"
This changes enables a user to add photos directly to an album while browsing through them in the photo viewer.
Selecting Add->Album will open the AlbumSelector widget.
Fixes # (issue)
none
How Has This Been Tested?
Manual testing following scenarios:
General scenarios:
Each above scenario:
Screenshots (if appropriate)
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
no LLM
...