Implemented loader action to push multiple versions

This commit is contained in:
Petr Kalis 2025-08-18 13:32:15 +02:00
parent ef9ab3bcdc
commit 965f937e28

View file

@ -28,25 +28,22 @@ class PushToLibraryProject(load.ProductLoaderPlugin):
if not filtered_contexts:
raise LoadError("Nothing to push for your selection")
if len(filtered_contexts) > 1:
raise LoadError("Please select only one item")
context = tuple(filtered_contexts)[0]
push_tool_script_path = os.path.join(
AYON_CORE_ROOT,
"tools",
"push_to_project",
"main.py"
)
project_name = tuple(filtered_contexts)[0]["project"]["name"]
project_name = context["project"]["name"]
version_id = context["version"]["id"]
version_ids = []
for context in filtered_contexts:
version_ids.append(context["version"]["id"])
args = get_ayon_launcher_args(
"run",
push_tool_script_path,
"--project", project_name,
"--version", version_id
"--versions", ",".join(version_ids)
)
run_detached_process(args)