mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
parallelize restoreFromTrash calls with Future.wait
format trash.provider.dart
This commit is contained in:
parent
b0aab9a84c
commit
22ae3e1da6
2 changed files with 4 additions and 4 deletions
|
|
@ -65,9 +65,9 @@ class TrashService {
|
|||
);
|
||||
if (remoteAssetsToRestore.isNotEmpty) {
|
||||
_logger.info("Restoring from trash ${remoteAssetsToRestore.map((e) => e.name).join(", ")} assets");
|
||||
for (final remoteAsset in remoteAssetsToRestore) {
|
||||
await _localFilesManager.restoreFromTrash(remoteAsset.name, remoteAsset.type.index);
|
||||
}
|
||||
await Future.wait(
|
||||
remoteAssetsToRestore.map((asset) => _localFilesManager.restoreFromTrash(asset.name, asset.type.index)),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/services/trash.service.dart';
|
||||
import 'package:immich_mobile/entities/asset.entity.dart';
|
||||
import 'package:immich_mobile/services/trash.service.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
class TrashNotifier extends StateNotifier<bool> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue