Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ayon_api/entity_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ def get_or_fetch_entity_by_id(
self.project_name,
entity_id,
fields=self._get_folder_fields(),
own_attributes=True
own_attributes=True,
)
elif entity_type == "task":
entity_data = self._connection.get_task_by_id(
self.project_name,
entity_id,
fields=self._get_task_fields(),
own_attributes=True
own_attributes=True,
)
elif entity_type == "product":
entity_data = self._connection.get_product_by_id(
Expand Down Expand Up @@ -781,6 +781,7 @@ def _fetch_entity_children(self, entity: BaseEntity) -> None:
parent_ids=[entity.id],
fields=folder_fields,
own_attributes=True,
active=None,
))

elif entity.entity_type == "folder":
Expand All @@ -789,13 +790,15 @@ def _fetch_entity_children(self, entity: BaseEntity) -> None:
parent_ids=[entity.id],
fields=folder_fields,
own_attributes=True,
active=None,
))

tasks = list(self._connection.get_tasks(
self.project_entity["name"],
folder_ids=[entity.id],
fields=task_fields,
own_attributes=True,
active=None,
))

children_ids = {
Expand Down Expand Up @@ -897,7 +900,7 @@ def fill_project_from_server(self) -> ProjectEntity:
project_name = self.project_name
project = self._connection.get_project(
project_name,
own_attributes=True
own_attributes=True,
)
if not project:
raise ValueError(f"Project \"{project_name}\" was not found.")
Expand Down Expand Up @@ -949,11 +952,13 @@ def fetch_hierarchy_entities(self) -> None:
project_entity.name,
fields=folder_fields,
own_attributes=True,
active=None,
)
tasks = self._connection.get_tasks(
project_entity.name,
fields=task_fields,
own_attributes=True,
active=None,
)
folders_by_parent_id = collections.defaultdict(list)
for folder in folders:
Expand Down