feat: odometer in trips/overview, trips upload toggle, fix video count

- OBD odometer now logged to tracking rows on every GPS snapshot
- trips table: START_ODOMETER/END_ODOMETER columns (migration)
- build_trip_summaries: picks odometer from first/last tracking row
- list_trips: uses real OBD odo, falls back to cumulative distance
- overview stats: odometer_km (max seen from OBD), video_count fixed
- history page: Odometer column shows start→end km per trip
- app_upload: TRIPS_UPLOAD_SETTING_KEY, is_trips_upload_enabled()
- _upload_tracking_batch: skips when trips upload is off
- settings: separate 'Upload trips & GPS' toggle from dashcam toggle

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-10 02:07:31 -04:00
co-authored by Copilot
parent 414fb78543
commit afce229310
9 changed files with 80 additions and 21 deletions
+5
View File
@@ -37,6 +37,7 @@ def _number_value(setting_key, converter):
def get_settings():
return {
"dashcam_upload_enabled": app_upload.is_dashcam_upload_enabled(),
"trips_upload_enabled": app_upload.is_trips_upload_enabled(),
"local_video_retention_days": app_video.retention_days(),
"video_convert_enabled": app_video.is_convert_enabled(),
"cellular_enabled": _setting_bool(
@@ -99,6 +100,7 @@ def update_settings(body):
values = {}
for field in (
"dashcam_upload_enabled",
"trips_upload_enabled",
"video_convert_enabled",
"cellular_enabled",
"ntfy_enabled",
@@ -184,6 +186,9 @@ def update_settings(body):
app_upload.DASHCAM_UPLOAD_SETTING_KEY: (
"1" if values["dashcam_upload_enabled"] else "0"
),
app_upload.TRIPS_UPLOAD_SETTING_KEY: (
"1" if values["trips_upload_enabled"] else "0"
),
app_video.RETENTION_SETTING: str(values["local_video_retention_days"]),
app_video.CONVERT_SETTING: "1" if values["video_convert_enabled"] else "0",
"cellular_enabled": "1" if values["cellular_enabled"] else "0",