second pass. medium

This commit is contained in:
Davide Scaini
2026-04-01 11:05:00 +02:00
parent 94369606a4
commit 3d364c3992
7 changed files with 34 additions and 15 deletions
+2 -1
View File
@@ -155,9 +155,10 @@ def merge_all(data_dir: Path) -> int:
edits = {}
else:
edits = {}
_ATHLETE_EDITABLE = {"max_hr", "ftp_w", "hr_zones", "power_zones", "seasons", "gear"}
if edits:
athlete_data = json.loads(athlete_src.read_text(encoding="utf-8"))
athlete_data.update(edits)
athlete_data.update({k: v for k, v in edits.items() if k in _ATHLETE_EDITABLE})
athlete_dest.write_text(json.dumps(athlete_data, indent=2, ensure_ascii=False))
else:
athlete_dest.symlink_to(athlete_src.resolve())