mirror of
https://github.com/immich-app/immich.git
synced 2025-08-30 23:02:39 -04:00
chore: use foreground service for uploading large file on Android (#21095)
* chore: use foreground service for uploading large file on Android * Update main.dart Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> * Update mobile/lib/main.dart Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> --------- Co-authored-by: shenlong <139912620+shenlong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
a1beb0a87d
commit
0e7816130b
@ -3,7 +3,7 @@
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
|
@ -94,7 +94,9 @@ Future<void> initApp() async {
|
||||
// Initialize the file downloader
|
||||
await FileDownloader().configure(
|
||||
// maxConcurrent: 6, maxConcurrentByHost(server):6, maxConcurrentByGroup: 3
|
||||
globalConfig: (Config.holdingQueue, (6, 6, 3)),
|
||||
|
||||
// On Android, if files are larger than 256MB, run in foreground service
|
||||
globalConfig: [(Config.holdingQueue, (6, 6, 3)), (Config.runInForegroundIfFileLargerThan, 256)],
|
||||
);
|
||||
|
||||
await FileDownloader().trackTasksInGroup(kDownloadGroupLivePhoto, markDownloadedComplete: false);
|
||||
@ -182,6 +184,13 @@ class ImmichAppState extends ConsumerState<ImmichApp> with WidgetsBindingObserve
|
||||
complete: TaskNotification('upload_finished'.tr(), '${'file_name'.tr()}: {displayName}'),
|
||||
progressBar: true,
|
||||
);
|
||||
|
||||
FileDownloader().configureNotificationForGroup(
|
||||
kBackupGroup,
|
||||
running: TaskNotification('uploading_media'.tr(), '${'file_name'.tr()}: {displayName}'),
|
||||
complete: TaskNotification('upload_finished'.tr(), '${'file_name'.tr()}: {displayName}'),
|
||||
progressBar: true,
|
||||
);
|
||||
}
|
||||
|
||||
Future<DeepLink> _deepLinkBuilder(PlatformDeepLink deepLink) async {
|
||||
|
Loading…
x
Reference in New Issue
Block a user