athlete page first draft

This commit is contained in:
Davide Scaini
2026-03-30 09:05:18 +02:00
parent 2a1493a3e5
commit ec6175b143
8 changed files with 594 additions and 3 deletions
+16 -2
View File
@@ -94,6 +94,7 @@ def _process_file(path: Path) -> dict:
"started_at": activity.started_at.isoformat(),
"distance_m": metrics.distance_m,
"source": summary.get("source"),
"mmp": metrics.mmp,
}
@@ -210,12 +211,25 @@ def extract(
))
summaries.append(result["summary"])
from bincio.extract.writer import write_index
from bincio.extract.writer import write_athlete_json, write_index
existing = _load_existing_summaries(cfg.output_dir)
merged = {s["id"]: s for s in existing}
for s in summaries:
merged[s["id"]] = s
write_index(list(merged.values()), cfg.output_dir, owner)
all_summaries = list(merged.values())
write_index(all_summaries, cfg.output_dir, owner)
athlete_config: dict = {}
if cfg.athlete:
ath = cfg.athlete
athlete_config = {k: v for k, v in {
"max_hr": ath.max_hr,
"ftp_w": ath.ftp_w,
"hr_zones": ath.hr_zones,
"power_zones": ath.power_zones,
}.items() if v is not None}
write_athlete_json(all_summaries, cfg.output_dir, athlete_config)
dedup.save()
console.print(