From 2c00b74cc02b55e26d68fef108596aae56080d5a Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Sat, 8 Aug 2026 10:05:05 +0200 Subject: feat: Persist Cotacol ride values --- cli/cli.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/cli.go') diff --git a/cli/cli.go b/cli/cli.go index 6e427bb..1d1b0f3 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -14,6 +14,7 @@ import ( "github.com/martinlehoux/biking_home/mountain_pass" "github.com/martinlehoux/biking_home/osmpass" "github.com/martinlehoux/biking_home/ride" + "github.com/martinlehoux/biking_home/rides" "github.com/martinlehoux/biking_home/web" "github.com/martinlehoux/kagamigo/kcore" ) @@ -25,6 +26,7 @@ var ( fetchOSM = flag.Bool("fetch-osm", false, "download the France OSM PBF (resumable) into france-latest.osm.pbf") extractOSM = flag.String("extract-osm", "", "extract mountain passes from an OSM PBF file into the database") enrich = flag.Bool("enrich", false, "backfill mountain pass coordinates from OSM data") + backfill = flag.Bool("backfill", false, "recompute all stored ride values") chartFile = flag.String("chart", "", "render a climb/pass chart for a GPX file") parser = ride.GPXRideParser{} ) @@ -46,6 +48,10 @@ func Run(db *sql.DB, configPath string, appConfig config.Config) { case *enrich: _, err := osmpass.EnrichMountainPasses(db) kcore.Expect(err, "failed to enrich mountain passes") + case *backfill: + count, err := rides.Backfill(db) + kcore.Expect(err, "failed to backfill ride values") + slog.Info("Backfilled ride values", "rides", count) case *chartFile != "": runChart(db, *chartFile) default: -- cgit v1.2.3