Repository navigation
feat(mobile): add bulk download functionality - #18878
Conversation
- Added `downloadAll` method to `IDownloadRepository` and its implementation in `DownloadRepository` to handle multiple asset downloads. - Implemented `downloadAllAsset` in `DownloadStateNotifier` to trigger bulk downloads. - Updated `DownloadService` to create download tasks for all selected assets. - Enhanced UI with new download success and failure messages in `en.json`. - Added download button to `ControlBottomAppBar` and integrated download functionality in `MultiselectGrid`.
alextran1502
left a comment
There was a problem hiding this comment.
Very clear and concise code! Thanks
shenlong-tanwen
left a comment
There was a problem hiding this comment.
Kindly address the comments and update the translation strings to use ICU message format. Thanks for the contribution
Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com>
…obiJoba/immich into download-in-multi-select-files
- Changed the download method to utilize downloadAll for handling multiple tasks. - Simplified remoteId check by removing unnecessary condition.
|
All changes from @shenlong-tanwen done; thanks for the review |
|
I'm not sure what makes the i18 fail - someone does have an idea? |
The keys in the translation file must be sorted. You can run the following command from the root directory |
|
Thanks @shenlong-tanwen ; Do you think we should remove @override
Future<bool> download(DownloadTask task) {
return FileDownloader().enqueue(task);
}as it is not used anywhere now? or should I maybe modify the logic to if only one task call the download method, else call the downloadAll? I've tried with one asset and multiple asset; all of them download the file correctly |
|
We can remove it and keep things simple. Thanks a lot for working on this |
|
Tested and worked well! One potential complaint I can foresee is that "there is no progress bar for the bulk download, so I don't know when it is done" |
|
I was thinking the same, want me to look at how to add the progress bar? (I've tried to add the component but it didn't work but I didn't really look into it) |
|
Thank you for the great feature. A couple of suggestions. I think that downloading a copy by default is suboptimal. Why not make it a non-default user preference or have a separate Also showing the file at the top of the stack, does it mean mtime is being messed up? |
* feat(mobile): add bulk download functionality and update UI messages - Added `downloadAll` method to `IDownloadRepository` and its implementation in `DownloadRepository` to handle multiple asset downloads. - Implemented `downloadAllAsset` in `DownloadStateNotifier` to trigger bulk downloads. - Updated `DownloadService` to create download tasks for all selected assets. - Enhanced UI with new download success and failure messages in `en.json`. - Added download button to `ControlBottomAppBar` and integrated download functionality in `MultiselectGrid`. * translations use i18n method t() * Update mobile/lib/services/download.service.dart Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> * fix(mobile): update download logic in DownloadService - Changed the download method to utilize downloadAll for handling multiple tasks. - Simplified remoteId check by removing unnecessary condition. * sort i18n keys * remove the download signature from interface and logic as we use the downloadAll now --------- Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com>
downloadAllmethod toIDownloadRepositoryand its implementation inDownloadRepositoryto handle multiple asset downloads.downloadAllAssetinDownloadStateNotifierto trigger bulk downloads.DownloadServiceto create download tasks for all selected assets.en.json.ControlBottomAppBarand integrated download functionality inMultiselectGrid.Description
Feature request from #5068
Few decision has been taken:
I've made a small typo fix which is not really related to this issue here:
(hasMerged was there two time instead of hasLocal)
--
I think how it works currently is ok but in a better world I would like to also let people download a picture that is only local.
What do you think?
Fixes # (issue)
How Has This Been Tested?
--
--
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/)