@@ -118,7 +118,7 @@ def fill_annotation_ids(
118118 ][attribute ["groupName" ]]["attributes" ][attribute ["name" ]]
119119
120120
121- def convert_to_video_editor_json (data : dict , class_name_mapper : dict ):
121+ def convert_to_video_editor_json (data : dict , class_name_mapper : dict , reporter : Reporter ):
122122 def safe_time (timestamp ):
123123 return "0" if str (timestamp ) == "0.0" else timestamp
124124
@@ -170,12 +170,18 @@ def convert_timestamp(timestamp):
170170 ]
171171
172172 if not class_name_mapper .get (meta ["className" ], None ):
173+ reporter .store_message ("missing_classes" , meta ["className" ])
173174 continue
174175
175176 existing_attributes_in_current_instance = set ()
176177 for attribute in timestamp_data ["attributes" ]:
177- key = attribute ["groupName" ], attribute ["name" ]
178- existing_attributes_in_current_instance .add (key )
178+ group_name , attr_name = attribute .get ("groupName" ), attribute .get ("name" )
179+ if not class_name_mapper [class_name ].get ("attribute_groups" , {}).get (group_name ):
180+ reporter .store_message ("missing_attribute_groups" , f"{ class_name } .{ group_name } " )
181+ elif not class_name_mapper [class_name ]["attribute_groups" ][group_name ].get ("attributes" , {}).get (attr_name ):
182+ reporter .store_message ("missing_attributes" , f"{ class_name } .{ group_name } .{ attr_name } " )
183+ else :
184+ existing_attributes_in_current_instance .add ((group_name , attr_name ))
179185 attributes_to_add = (
180186 existing_attributes_in_current_instance - active_attributes
181187 )
@@ -212,7 +218,6 @@ def convert_timestamp(timestamp):
212218 editor_instance ["timeline" ][timestamp ]["attributes" ]["-" ].append (
213219 attr
214220 )
215-
216221 editor_data ["instances" ].append (editor_instance )
217222 return editor_data
218223
0 commit comments