#1331 ignore attempts to move file to its current folder
This commit is contained in:
parent
892e64ef28
commit
16da0ec3f5
2 changed files with 11 additions and 2 deletions
|
@ -93,6 +93,7 @@ import java.util.zip.CRC32;
|
||||||
/*
|
/*
|
||||||
* Forked from 'androidx.exifinterface:exifinterface:1.4.0-beta01' on 2025/01/21
|
* Forked from 'androidx.exifinterface:exifinterface:1.4.0-beta01' on 2025/01/21
|
||||||
* Named differently to let ExifInterface be loaded as subdependency.
|
* Named differently to let ExifInterface be loaded as subdependency.
|
||||||
|
* cf https://maven.google.com/web/index.html?q=exifinterface#androidx.exifinterface:exifinterface
|
||||||
* cf https://github.com/androidx/androidx/tree/androidx-main/exifinterface/exifinterface/src/main/java/androidx/exifinterface/media
|
* cf https://github.com/androidx/androidx/tree/androidx-main/exifinterface/exifinterface/src/main/java/androidx/exifinterface/media
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -162,13 +162,21 @@ mixin EntryStorageMixin on FeedbackMixin, PermissionAwareMixin, SizeAwareMixin {
|
||||||
Future<void> doQuickMove(
|
Future<void> doQuickMove(
|
||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required MoveType moveType,
|
required MoveType moveType,
|
||||||
required Map<String, Iterable<AvesEntry>> entriesByDestination,
|
required Map<String, Set<AvesEntry>> entriesByDestination,
|
||||||
bool hideShowAction = false,
|
bool hideShowAction = false,
|
||||||
VoidCallback? onSuccess,
|
VoidCallback? onSuccess,
|
||||||
}) async {
|
}) async {
|
||||||
|
if (moveType == MoveType.move) {
|
||||||
|
// skip moving entries to their directory
|
||||||
|
entriesByDestination.forEach((destinationAlbum, entries) {
|
||||||
|
entries.removeWhere((entry) => entry.directory == destinationAlbum);
|
||||||
|
});
|
||||||
|
entriesByDestination.removeWhere((_, entries) => entries.isEmpty);
|
||||||
|
}
|
||||||
|
|
||||||
final entries = entriesByDestination.values.expand((v) => v).toSet();
|
final entries = entriesByDestination.values.expand((v) => v).toSet();
|
||||||
final todoCount = entries.length;
|
final todoCount = entries.length;
|
||||||
assert(todoCount > 0);
|
if (todoCount == 0) return;
|
||||||
|
|
||||||
final toBin = moveType == MoveType.toBin;
|
final toBin = moveType == MoveType.toBin;
|
||||||
final copy = moveType == MoveType.copy;
|
final copy = moveType == MoveType.copy;
|
||||||
|
|
Loading…
Reference in a new issue