mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: delete action button (#20261)
This commit is contained in:
parent
b14c768208
commit
3a5d82f790
11 changed files with 162 additions and 9 deletions
|
|
@ -230,6 +230,22 @@ class ActionNotifier extends Notifier<void> {
|
|||
}
|
||||
}
|
||||
|
||||
Future<ActionResult> trashRemoteAndDeleteLocal(ActionSource source) async {
|
||||
final ids = _getOwnedRemoteIdsForSource(source);
|
||||
final localIds = _getLocalIdsForSource(source);
|
||||
try {
|
||||
await _service.trashRemoteAndDeleteLocal(ids, localIds);
|
||||
return ActionResult(count: ids.length, success: true);
|
||||
} catch (error, stack) {
|
||||
_logger.severe('Failed to delete assets', error, stack);
|
||||
return ActionResult(
|
||||
count: ids.length,
|
||||
success: false,
|
||||
error: error.toString(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<ActionResult> deleteRemoteAndLocal(ActionSource source) async {
|
||||
final ids = _getOwnedRemoteIdsForSource(source);
|
||||
final localIds = _getLocalIdsForSource(source);
|
||||
|
|
@ -249,8 +265,8 @@ class ActionNotifier extends Notifier<void> {
|
|||
Future<ActionResult> deleteLocal(ActionSource source) async {
|
||||
final ids = _getLocalIdsForSource(source);
|
||||
try {
|
||||
await _service.deleteLocal(ids);
|
||||
return ActionResult(count: ids.length, success: true);
|
||||
final deletedCount = await _service.deleteLocal(ids);
|
||||
return ActionResult(count: deletedCount, success: true);
|
||||
} catch (error, stack) {
|
||||
_logger.severe('Failed to delete assets', error, stack);
|
||||
return ActionResult(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue