Synchronize pair camera metadata
This commit is contained in:
@@ -141,6 +141,29 @@ def synchronize_pair_side_metadata(pair: dict[str, Any]) -> dict[str, Any]:
|
||||
return pair
|
||||
|
||||
|
||||
def synchronize_pair_camera_metadata(pair: dict[str, Any]) -> dict[str, Any]:
|
||||
mapping = {
|
||||
"softcore_row": (
|
||||
("softcore_camera_config", "camera_config"),
|
||||
("softcore_camera_directive", "camera_directive"),
|
||||
("softcore_camera_scene_directive", "camera_scene_directive"),
|
||||
),
|
||||
"hardcore_row": (
|
||||
("hardcore_camera_config", "camera_config"),
|
||||
("hardcore_camera_directive", "camera_directive"),
|
||||
("hardcore_camera_scene_directive", "camera_scene_directive"),
|
||||
),
|
||||
}
|
||||
for row_key, keys in mapping.items():
|
||||
row = pair.get(row_key)
|
||||
if not isinstance(row, dict):
|
||||
continue
|
||||
for source_key, target_key in keys:
|
||||
if source_key in pair:
|
||||
row[target_key] = pair.get(source_key)
|
||||
return pair
|
||||
|
||||
|
||||
def synchronize_pair_cast_metadata(pair: dict[str, Any]) -> dict[str, Any]:
|
||||
descriptors = pair.get("shared_cast_descriptors")
|
||||
if isinstance(descriptors, list):
|
||||
@@ -170,6 +193,7 @@ def normalize_pair_metadata(pair: dict[str, Any], *, active_trigger: str = "") -
|
||||
triggers = _trigger_tuple(trigger)
|
||||
synchronize_pair_row_outputs(pair)
|
||||
synchronize_pair_side_metadata(pair)
|
||||
synchronize_pair_camera_metadata(pair)
|
||||
synchronize_pair_cast_metadata(pair)
|
||||
for key in ("softcore_prompt", "hardcore_prompt"):
|
||||
if key in pair:
|
||||
|
||||
Reference in New Issue
Block a user