From 53615a05708ff852af42905e2b5ced66ba70c43d Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Sun, 23 Aug 2026 11:09:07 +0200 Subject: Merge ride and rides packages into ride/store following mountain_pass structure Consolidate persistence (Save, List, Backfill) into ride/store.go alongside ride.go/climb.go/moving_time.go, rename rides.Ride to ride.StoredRide to avoid collision with parsed ride.Ride, update all web/cli consumers and RideView to use named Ride field, adjust templates and regenerate templ files, and remove rides directory. --- cli/cli.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cli/cli.go') diff --git a/cli/cli.go b/cli/cli.go index 52b5a8c..68a86a6 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -16,7 +16,6 @@ import ( "github.com/martinlehoux/biking_home/config" "github.com/martinlehoux/biking_home/mountain_pass" "github.com/martinlehoux/biking_home/ride" - "github.com/martinlehoux/biking_home/rides" "github.com/martinlehoux/biking_home/web" "github.com/martinlehoux/kagamigo/kcore" ) @@ -42,7 +41,7 @@ func Run(db *sql.DB, configPath string, appConfig config.Config) { _, err := mountain_pass.ExtractMountainPasses(context.Background(), *extractOSM, db) kcore.Expect(err, "failed to extract mountain passes from OSM") case *backfill: - count, err := rides.Backfill(db) + count, err := ride.Backfill(db) kcore.Expect(err, "failed to backfill ride values") slog.Info("Backfilled ride values", "rides", count) case *backtest: @@ -67,7 +66,7 @@ type backtestSample struct { } func runBacktest(db *sql.DB) error { - items, err := rides.List(db) + items, err := ride.List(db) if err != nil { return err } @@ -128,7 +127,7 @@ func runBacktest(db *sql.DB) error { return nil } -func isBacktestEligible(item rides.Ride) bool { +func isBacktestEligible(item ride.StoredRide) bool { return item.GPXPath != "" && item.DistanceM >= backtestMinimumDistanceM && item.ExternalMovingTimeS > 0 && -- cgit v1.3