mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(mobile): archive action (#19630)
* feat(mobile): archive action * fix: lint * Update i18n/en.json Co-authored-by: Alex <alex.tran1502@gmail.com> * fix: lint * fix: lint --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
53020852ec
commit
32a7087883
7 changed files with 114 additions and 3 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:immich_mobile/constants/enums.dart';
|
||||
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/remote_asset.repository.dart';
|
||||
import 'package:immich_mobile/repositories/asset_api.repository.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
|
@ -33,4 +35,34 @@ class ActionService {
|
|||
debugPrint('Error unfavoriting assets: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> archive(List<String> remoteIds) async {
|
||||
try {
|
||||
await _assetApiRepository.updateVisibility(
|
||||
remoteIds,
|
||||
AssetVisibilityEnum.archive,
|
||||
);
|
||||
await _remoteAssetRepository.updateVisibility(
|
||||
remoteIds,
|
||||
AssetVisibility.archive,
|
||||
);
|
||||
} catch (e) {
|
||||
debugPrint('Error archive assets: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> unArchive(List<String> remoteIds) async {
|
||||
try {
|
||||
await _assetApiRepository.updateVisibility(
|
||||
remoteIds,
|
||||
AssetVisibilityEnum.timeline,
|
||||
);
|
||||
await _remoteAssetRepository.updateVisibility(
|
||||
remoteIds,
|
||||
AssetVisibility.timeline,
|
||||
);
|
||||
} catch (e) {
|
||||
debugPrint('Error unarchive assets: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue