mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: new upload (cont) (#20029)
* new upload button * wip * pr feedback * fix: updateAll override album selection value * feat: status box * feat: handle upload resume * re-enable websocket event * fix: update state condition and upload status * Better backup detail page --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
1dc62fce5f
commit
4d27f187ea
26 changed files with 1558 additions and 413 deletions
|
|
@ -9,6 +9,7 @@ import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
|||
import 'package:immich_mobile/infrastructure/repositories/backup.repository.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/local_asset.repository.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/storage.repository.dart';
|
||||
import 'package:immich_mobile/providers/backup/drift_backup.provider.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/asset.provider.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/storage.provider.dart';
|
||||
import 'package:immich_mobile/services/upload.service.dart';
|
||||
|
|
@ -55,7 +56,9 @@ class DriftBackupService {
|
|||
return _backupRepository.getBackupCount();
|
||||
}
|
||||
|
||||
Future<void> backup() async {
|
||||
Future<void> backup(
|
||||
void Function(EnqueueStatus status) onEnqueueTasks,
|
||||
) async {
|
||||
shouldCancel = false;
|
||||
|
||||
final candidates = await _backupRepository.getCandidates();
|
||||
|
|
@ -83,8 +86,12 @@ class DriftBackupService {
|
|||
if (tasks.isNotEmpty && !shouldCancel) {
|
||||
count += tasks.length;
|
||||
_uploadService.enqueueTasks(tasks);
|
||||
debugPrint(
|
||||
"Enqueued $count/${candidates.length} tasks for backup",
|
||||
|
||||
onEnqueueTasks(
|
||||
EnqueueStatus(
|
||||
enqueueCount: count,
|
||||
totalCount: candidates.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -213,7 +220,7 @@ class DriftBackupService {
|
|||
deviceAssetId: asset.id,
|
||||
fields: fields,
|
||||
group: kBackupLivePhotoGroup,
|
||||
priority: 0,
|
||||
priority: 0, // Highest priority to get upload immediately
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue