Add support for collection items in copy/move actions#32
Open
GoldenAnpu wants to merge 3 commits into
Open
Conversation
Resolve entities collection IDs from modal.state.items into a flat list of images and process them via a dedicated path. Same-named images from different datasets get the source dataset ID appended to the name.
738b987 to
d5d3a83
Compare
Collections named like "Filtered entities <timestamp>" are renamed to "Data Commander (Task <ID>)" when the task processes them, so the origin of the collection stays visible. Custom-named collections are left untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
collectionas a supporteditemstype forcopy/moveactions: an entities collection is resolved into a flat list of images and transferred into the destination dataset without preserving source structure.Changes
resolve_collection_items()— resolves each collection item viaapi.entities_collection.get_info_by_id()+get_items()into a flat list of image items. Supports bothdefaultandaiSearchcollection types. Falls back to the collection's ownproject_idwhensource.project.idis not set in the state.copy_collection_items_to_dataset()/move_collection_items_to_dataset()— dedicated processing path: all images land in the destination dataset without preserving source structure. Move keeps the existing safety net: source items are not deleted unless every item was transferred.disambiguate_collection_names()— a collection can contain same-named images from different datasets; every image involved in a name conflict gets_<src dataset ID>appended before the extension (e.g.img.pngfrom datasets 100 and 200 →img_100.png/img_200.png), so the origin of each copy stays visible. Residual collisions are resolved viagenerate_free_name. Without this,skip/replacemodes silently dropped duplicates (and cancelled source deletion on move), whilerenamemode could fail the whole upload batch.rename_filtered_collection()— auto-created filter collections (named likeFiltered entities 2026-07-03T14-31-57-501Z) are renamed toData Commander (Task <ID>)when the task processes them, so it is clear which task handled the collection. Collections with custom names are left untouched; a rename failure does not fail the task.options.conflictResolutionMode.State example
{ "state": { "action": "copy", "options": {"conflictResolutionMode": "rename", "cloneAnnotations": true, "preserveSrcDate": false}, "items": [{"id": 2863, "type": "collection"}], "source": {"team": {"id": 10}, "workspace": {"id": 9}, "project": {"id": 7548}}, "destination": {"team": {"id": 10}, "workspace": {"id": 9}, "project": {"id": 7549}, "dataset": {"id": 45188}} } }Notes