fix high priority issues
This commit is contained in:
@@ -83,6 +83,13 @@ def write_activity(
|
||||
}
|
||||
|
||||
json_path = acts_dir / f"{activity_id}.json"
|
||||
# Collision guard: if a *different* activity already has this ID, append a
|
||||
# short hash suffix to disambiguate (same hash = idempotent re-extract).
|
||||
if json_path.exists():
|
||||
existing = json.loads(json_path.read_text(encoding="utf-8"))
|
||||
if existing.get("source_hash") != activity.source_hash:
|
||||
activity_id = f"{activity_id}-{activity.source_hash[-6:]}"
|
||||
json_path = acts_dir / f"{activity_id}.json"
|
||||
json_path.write_text(json.dumps(detail, indent=2, ensure_ascii=False))
|
||||
|
||||
# ── GeoJSON track ────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user