fix: server odometer stat shows 0 when no odometer data exists

COALESCE(MAX(odometer), 0) returned 0 when all tracking rows have NULL
odometer (expected before the car is connected — PID 0xA6 likely unsupported
on 2013 Yaris). Now returns NULL which the overview JS renders as '—'.

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-10 05:58:22 -04:00
co-authored by Copilot
parent a7ab088cf5
commit 8f8c03a26a
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ async function loadStats() {
document.getElementById('stat-drivetime').textContent = fmtDuration(d.total_drive_time_s);
document.getElementById('stat-topspeed').textContent = d.top_speed_kmh.toFixed(0);
document.getElementById('stat-videos').textContent = d.video_count;
document.getElementById('stat-odometer').textContent = d.odometer_km.toFixed(0);
document.getElementById('stat-odometer').textContent = d.odometer_km != null ? d.odometer_km.toFixed(0) : '—';
}
async function loadRecentTrips() {