mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: finish drift locked page (#20013)
* feat: overlay mechanism * handle merged asset local id extraction * locked view asset viewer actions * pr feedback
This commit is contained in:
parent
dcfe8d5ade
commit
5d244c6fec
11 changed files with 143 additions and 26 deletions
|
|
@ -47,7 +47,18 @@ class ActionNotifier extends Notifier<void> {
|
|||
}
|
||||
|
||||
List<String> _getLocalIdsForSource(ActionSource source) {
|
||||
return _getIdsForSource<LocalAsset>(source).toIds().toList(growable: false);
|
||||
final Set<BaseAsset> assets = _getAssets(source);
|
||||
final List<String> localIds = [];
|
||||
|
||||
for (final asset in assets) {
|
||||
if (asset is LocalAsset) {
|
||||
localIds.add(asset.id);
|
||||
} else if (asset is RemoteAsset && asset.localId != null) {
|
||||
localIds.add(asset.localId!);
|
||||
}
|
||||
}
|
||||
|
||||
return localIds;
|
||||
}
|
||||
|
||||
List<String> _getOwnedRemoteIdsForSource(ActionSource source) {
|
||||
|
|
@ -162,8 +173,9 @@ class ActionNotifier extends Notifier<void> {
|
|||
|
||||
Future<ActionResult> moveToLockFolder(ActionSource source) async {
|
||||
final ids = _getOwnedRemoteIdsForSource(source);
|
||||
final localIds = _getLocalIdsForSource(source);
|
||||
try {
|
||||
await _service.moveToLockFolder(ids);
|
||||
await _service.moveToLockFolder(ids, localIds);
|
||||
return ActionResult(count: ids.length, success: true);
|
||||
} catch (error, stack) {
|
||||
_logger.severe('Failed to move assets to lock folder', error, stack);
|
||||
|
|
@ -329,7 +341,3 @@ extension on Iterable<RemoteAsset> {
|
|||
return whereType<RemoteAsset>().where((a) => a.ownerId == ownerId);
|
||||
}
|
||||
}
|
||||
|
||||
extension on Iterable<LocalAsset> {
|
||||
Iterable<String> toIds() => map((e) => e.id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue