diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-23 11:09:07 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-23 11:09:07 +0200 |
| commit | 53615a05708ff852af42905e2b5ced66ba70c43d (patch) | |
| tree | 5f936b6bb8a2305cff6c8d086e6ad5af4c1aa491 /cli/cli.go | |
| parent | 765ea1fffcc1bd1af2e6e9645d6f138dfd4ae0eb (diff) | |
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.
Diffstat (limited to 'cli/cli.go')
| -rw-r--r-- | cli/cli.go | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 && |
