mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
Merge branch 'hotfix/ftrack_remove_fix' into develop
This commit is contained in:
commit
9515bc43d2
2 changed files with 25 additions and 3 deletions
|
|
@ -717,6 +717,9 @@ class SyncToAvalonEvent(BaseEvent):
|
|||
if not self.ftrack_removed:
|
||||
return
|
||||
ent_infos = self.ftrack_removed
|
||||
self.log.debug(
|
||||
"Processing removed entities: {}".format(str(ent_infos))
|
||||
)
|
||||
removable_ids = []
|
||||
recreate_ents = []
|
||||
removed_names = []
|
||||
|
|
@ -878,8 +881,9 @@ class SyncToAvalonEvent(BaseEvent):
|
|||
self.process_session.commit()
|
||||
|
||||
found_idx = None
|
||||
for idx, _entity in enumerate(self._avalon_ents):
|
||||
if _entity["_id"] == avalon_entity["_id"]:
|
||||
proj_doc, asset_docs = self._avalon_ents
|
||||
for idx, asset_doc in enumerate(asset_docs):
|
||||
if asset_doc["_id"] == avalon_entity["_id"]:
|
||||
found_idx = idx
|
||||
break
|
||||
|
||||
|
|
@ -894,7 +898,8 @@ class SyncToAvalonEvent(BaseEvent):
|
|||
new_entity_id
|
||||
)
|
||||
# Update cached entities
|
||||
self._avalon_ents[found_idx] = avalon_entity
|
||||
asset_docs[found_idx] = avalon_entity
|
||||
self._avalon_ents = proj_doc, asset_docs
|
||||
|
||||
if self._avalon_ents_by_id is not None:
|
||||
mongo_id = avalon_entity["_id"]
|
||||
|
|
@ -1258,6 +1263,10 @@ class SyncToAvalonEvent(BaseEvent):
|
|||
if not ent_infos:
|
||||
return
|
||||
|
||||
self.log.debug(
|
||||
"Processing renamed entities: {}".format(str(ent_infos))
|
||||
)
|
||||
|
||||
renamed_tasks = {}
|
||||
not_found = {}
|
||||
changeable_queue = queue.Queue()
|
||||
|
|
@ -1453,6 +1462,10 @@ class SyncToAvalonEvent(BaseEvent):
|
|||
if not ent_infos:
|
||||
return
|
||||
|
||||
self.log.debug(
|
||||
"Processing added entities: {}".format(str(ent_infos))
|
||||
)
|
||||
|
||||
cust_attrs, hier_attrs = self.avalon_cust_attrs
|
||||
entity_type_conf_ids = {}
|
||||
# Skip if already exit in avalon db or tasks entities
|
||||
|
|
@ -1729,6 +1742,10 @@ class SyncToAvalonEvent(BaseEvent):
|
|||
if not self.ftrack_moved:
|
||||
return
|
||||
|
||||
self.log.debug(
|
||||
"Processing moved entities: {}".format(str(self.ftrack_moved))
|
||||
)
|
||||
|
||||
ftrack_moved = {k: v for k, v in sorted(
|
||||
self.ftrack_moved.items(),
|
||||
key=(lambda line: len(
|
||||
|
|
@ -1859,6 +1876,10 @@ class SyncToAvalonEvent(BaseEvent):
|
|||
if not self.ftrack_updated:
|
||||
return
|
||||
|
||||
self.log.debug(
|
||||
"Processing updated entities: {}".format(str(self.ftrack_updated))
|
||||
)
|
||||
|
||||
ent_infos = self.ftrack_updated
|
||||
ftrack_mongo_mapping = {}
|
||||
not_found_ids = []
|
||||
|
|
|
|||
|
|
@ -2144,6 +2144,7 @@ class SyncEntitiesFactory:
|
|||
"name": _name,
|
||||
"parent": parent_entity
|
||||
})
|
||||
self.session.commit()
|
||||
|
||||
final_entity = {}
|
||||
for k, v in av_entity.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue