diff --git a/client/ayon_resolve/plugins/create/create_editorial_package.py b/client/ayon_resolve/plugins/create/create_editorial_package.py index 19f10fc170..4a00a51e4a 100644 --- a/client/ayon_resolve/plugins/create/create_editorial_package.py +++ b/client/ayon_resolve/plugins/create/create_editorial_package.py @@ -16,22 +16,13 @@ class CreateEditorialPackage(LegacyCreator): def process(self): """Process the creation of the editorial package.""" current_timeline = lib.get_current_timeline() - timeline_name = current_timeline.GetName() - - # get timeline media pool item for metadata update - timeline_media_pool_item = None - for item in lib.iter_all_media_pool_clips(): - item_name = item.GetName() - if item_name != timeline_name: - continue - timeline_media_pool_item = item - break - - # Update the metadata - if timeline_media_pool_item: - publish_data = {"publish": self.data} - timeline_media_pool_item.SetMetadata( - lib.pype_tag_name, json.dumps(publish_data) - ) - else: - NameError("Timeline not found in media pool.") + + timeline_media_pool_item = lib.get_timeline_media_pool_item( + current_timeline + ) + + publish_data = {"publish": self.data} + + timeline_media_pool_item.SetMetadata( + lib.pype_tag_name, json.dumps(publish_data) + )