mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
filter asset versions by asset type
This commit is contained in:
parent
3a24a38afb
commit
ef4d395ea7
1 changed files with 14 additions and 2 deletions
|
|
@ -47,14 +47,26 @@ class VersionToTaskStatus(BaseEvent):
|
|||
asset_version_ids.add(entity_info["entityId"])
|
||||
|
||||
# Query tasks for AssetVersions
|
||||
asset_version_entities = session.query(
|
||||
_asset_version_entities = session.query(
|
||||
"AsserVersion where task_id != none and id in ({})".format(
|
||||
self.join_query_keys(asset_version_ids)
|
||||
)
|
||||
).all()
|
||||
if not asset_version_entities:
|
||||
if not _asset_version_entities:
|
||||
return
|
||||
|
||||
# Filter asset versions by asset type and store their task_ids
|
||||
task_ids = set()
|
||||
asset_version_entities = []
|
||||
for asset_version in _asset_version_entities:
|
||||
if asset_version["asset"]["type"]["short"].lower() == "scene":
|
||||
continue
|
||||
asset_version_entities.append(asset_version)
|
||||
task_ids.add(asset_version["task_id"])
|
||||
|
||||
# Skipt if `task_ids` are empty
|
||||
if not task_ids:
|
||||
return
|
||||
asset_versions_by_id = {
|
||||
asset_version["id"]: asset_version
|
||||
for asset_version in asset_version_entities
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue