ynput / ayon-python-api

Apache License 2.0
8 stars 3 forks source link

Tasks by folder path #134

Closed iLLiCiTiT closed 4 months ago

iLLiCiTiT commented 4 months ago

Description

Added option to query tasks by folder path.

Additional information

Added functions that helps to get task entity by folder path and task names. The functionality is similar but not the same as with standard tasks getter so it was necessary to create new methods.

Why? We usually have available folder path instead of folder id which leads to double query, first folder by path and then task by folder id. This simplifies it to a single call.

How to test:

import ayon_api

# Fill missing
project_name = "..."
folder_path = "/..."
task_name = "..."

task_entity = ayon_api.get_task_by_folder_path(
    project_name, folder_path, task_name
)