second pass at issues. critical ones.

This commit is contained in:
Davide Scaini
2026-04-01 10:58:45 +02:00
parent 81438231b4
commit 94369606a4
4 changed files with 6 additions and 4 deletions
+1 -2
View File
@@ -76,8 +76,7 @@ def _process_file(path: Path) -> dict:
try: try:
metrics = compute(activity) metrics = compute(activity)
activity_id = make_activity_id(activity) activity_id = write_activity(
write_activity(
activity, metrics, _output_dir, activity, metrics, _output_dir,
privacy=_privacy, privacy=_privacy,
rdp_epsilon=_rdp_epsilon, rdp_epsilon=_rdp_epsilon,
+1
View File
@@ -90,6 +90,7 @@ def write_activity(
if existing.get("source_hash") != activity.source_hash: if existing.get("source_hash") != activity.source_hash:
activity_id = f"{activity_id}-{activity.source_hash[-6:]}" activity_id = f"{activity_id}-{activity.source_hash[-6:]}"
json_path = acts_dir / f"{activity_id}.json" json_path = acts_dir / f"{activity_id}.json"
detail["id"] = activity_id
json_path.write_text(json.dumps(detail, indent=2, ensure_ascii=False)) json_path.write_text(json.dumps(detail, indent=2, ensure_ascii=False))
# ── GeoJSON track ──────────────────────────────────────────────────────── # ── GeoJSON track ────────────────────────────────────────────────────────
+2 -1
View File
@@ -122,7 +122,8 @@
"minItems": 2, "minItems": 2,
"maxItems": 2 "maxItems": 2
} }
} },
"custom": { "type": "object" }
}, },
"additionalProperties": false "additionalProperties": false
} }
+2 -1
View File
@@ -98,7 +98,8 @@
} }
} }
} catch (e: any) { } catch (e: any) {
error = `Upload failed: ${e.message}`; saveStatus = `Upload failed: ${e.message}`;
saveOk = false;
} finally { } finally {
uploading = false; uploading = false;
} }