Metadata reformat done

This commit is contained in:
2025-05-13 09:21:38 +02:00
parent 1cd81cb87a
commit 6e7daf260a
3 changed files with 13 additions and 10 deletions

View File

@@ -203,9 +203,8 @@ class MetadataFinalizationAndSaveStage(ProcessingStage):
return [make_serializable(i) for i in data]
return data
# final_output_files is populated by OutputOrganizationStage and might be desired.
# The 'maps' structure is now the primary source for map file paths in metadata.
# context.asset_metadata.pop('final_output_files', None)
# final_output_files is populated by OutputOrganizationStage. Explicitly remove it as per user request.
context.asset_metadata.pop('final_output_files', None)
serializable_metadata = make_serializable(context.asset_metadata)
with open(metadata_save_path, 'w') as f:

View File

@@ -116,8 +116,8 @@ class OutputOrganizationStage(ProcessingStage):
# Optionally update variant_detail status if needed
# Store relative path in metadata
relative_final_variant_path_str = str(Path(relative_dir_path_str_variant) / Path(output_filename_variant))
map_metadata_entry['variant_paths'][variant_resolution_key] = relative_final_variant_path_str
# Store only the filename, as it's relative to the metadata.json location
map_metadata_entry['variant_paths'][variant_resolution_key] = output_filename_variant
processed_any_variant_successfully = True
except Exception as e:
@@ -189,7 +189,8 @@ class OutputOrganizationStage(ProcessingStage):
# map_type is now the key, so no need to store it inside the entry
# map_metadata_entry['map_type'] = base_map_type
# Store single path in variant_paths, keyed by its resolution string
map_metadata_entry.setdefault('variant_paths', {})[resolution_str] = str(Path(relative_dir_path_str) / Path(output_filename))
# Store only the filename, as it's relative to the metadata.json location
map_metadata_entry.setdefault('variant_paths', {})[resolution_str] = output_filename
# Remove old cleanup logic, as variant_paths is now the standard
# if 'variant_paths' in map_metadata_entry:
# del map_metadata_entry['variant_paths']