-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(mobile): Manual asset upload #3445
feat(mobile): Manual asset upload #3445
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Hello, what is the limitation of 30 uploads at once? |
It is a not a limitation of the stack but rather, a one set by us to easily handle cases such as:
I just felt it would be easier to handle such cases by asking the user to upload the assets in batches so that we can be sure that all the assets will be uploaded before the app is killed prematurely. Because with the current implementation, one can upload assets even without background / foreground sync enabled. We can remove the hard limit, but we might need to improve the current implementation to make it resilient to above cases. Even with the hard limit, it might be possible that the upload might be interrupted if a user is uploading a huge file and the app gets terminated somehow. |
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.
Looks cool! I didn't pull it down to try it out, but I left some initial thoughts above. I'm not super sure what the use case for this is, since I use the auto backup feature. I suppose there could be some confusion about uploading images manually versus automatically with this feature, but I doubt it's a big deal.
initialChildSize: hasRemote ? 0.30 : 0.15, | ||
minChildSize: 0.15, | ||
maxChildSize: 0.57, | ||
maxChildSize: hasRemote ? 0.57 : 0.15, |
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.
Why are these changed?
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.
Those are for the DraggableScrollbarSheet
related change where if all the selections are only local assets, we shouldn't let the user drag the bottom sheet and only present them with the options available for local only assets. Setting the initial and maximum values to the same seemed like an easier way to achieve it
I'm happy for this feature. I don't/wan't to use automatic backup, manual selective upload of photos is my use case. |
Hello, I've finished the first round of testing of this PR
|
True. I'll check if we can reuse the notification handling used for background upload for manual uploads as well. It should be possible with a little refactoring. |
This is to prevent the buttons in the bottom sheet getting clipped behind the 3 way navigation buttons in the default density of Android devices
Refactored the PR to handle upload progress update using local notifications. New dependency The notification works the same way as the change made in this PR - #781 except that the progress notifications are displayed always for manual uploads. Detailed notifications are displayed only when the user explicitly enables it under Notification settings. However, if a user is trying to upload only a single asset, we will display detailed notification for the single asset so as to provide better visibility when a user uploads a single large asset file. If the notification permission is not granted, the user will not be notified of the upload progress nor the final status of the upload. The older platform specific code for handling background service upload notification can be refactored to use this plugin in a separate PR. The other issue with App State not updating properly when uploading a video asset was due to us trying to show a toast when the context is unmounted. Since most part of them are refactored to use local notifications now, that issue should be fixed as well. |
Could you please make the limit much higher or rather remove it completely? |
I second that. Battery optimizations don't kick in if there is a foreground service notification (on Android, I don't know about iOS though). |
We can remove the limit for now and can re-add it in future if there are reports of the app getting killed. I'll handle this in the near future or you guys can feel free to open a PR to remove the hard limit. It is handled in the immich/mobile/lib/modules/home/views/home_page.dart Lines 153 to 159 in 5d1011b
|
Great feature, but currently the interaction is rather strange, will it be optimized for interaction in the future? For example, add an extra button to each album or homepage to realize the upload function |
I am planning to make this a bit more easier, yes. Adding an option to the local album page sounds like a great feature. Can you raise that as a separate FR in discussions? |
Sure. |
In this PR, I've added a basic support for #1684
Changes made in the PR
Local Only Selection
How Has This Been Tested?
✅ Multi asset upload from homepage
✅ Single asset upload from asset view
Potential Improvements