#335 fixed replacing entries during move/copy
This commit is contained in:
parent
3090439e19
commit
7c84f1a4a4
2 changed files with 11 additions and 0 deletions
|
@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
|
||||||
- opening viewer with directory context in some cases
|
- opening viewer with directory context in some cases
|
||||||
- photo frame widget rendering in some cases
|
- photo frame widget rendering in some cases
|
||||||
- exporting large images to BMP
|
- exporting large images to BMP
|
||||||
|
- replacing entries during move/copy
|
||||||
|
|
||||||
## <a id="v1.6.13"></a>[v1.6.13] - 2022-08-29
|
## <a id="v1.6.13"></a>[v1.6.13] - 2022-08-29
|
||||||
|
|
||||||
|
|
|
@ -283,6 +283,16 @@ abstract class CollectionSource with SourceBase, AlbumMixin, LocationMixin, TagM
|
||||||
}) async {
|
}) async {
|
||||||
if (movedOps.isEmpty) return;
|
if (movedOps.isEmpty) return;
|
||||||
|
|
||||||
|
final replacedUris = movedOps
|
||||||
|
.map((movedOp) => movedOp.newFields['path'] as String?)
|
||||||
|
.map((targetPath) {
|
||||||
|
final existingEntry = _rawEntries.firstWhereOrNull((entry) => entry.path == targetPath && !entry.trashed);
|
||||||
|
return existingEntry?.uri;
|
||||||
|
})
|
||||||
|
.whereNotNull()
|
||||||
|
.toSet();
|
||||||
|
await removeEntries(replacedUris, includeTrash: false);
|
||||||
|
|
||||||
final fromAlbums = <String?>{};
|
final fromAlbums = <String?>{};
|
||||||
final movedEntries = <AvesEntry>{};
|
final movedEntries = <AvesEntry>{};
|
||||||
final copy = moveType == MoveType.copy;
|
final copy = moveType == MoveType.copy;
|
||||||
|
|
Loading…
Reference in a new issue