aboutsummaryrefslogtreecommitdiff
path: root/cli/cli.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-23 11:09:07 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-23 11:09:07 +0200
commit53615a05708ff852af42905e2b5ced66ba70c43d (patch)
tree5f936b6bb8a2305cff6c8d086e6ad5af4c1aa491 /cli/cli.go
parent765ea1fffcc1bd1af2e6e9645d6f138dfd4ae0eb (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.go7
1 files changed, 3 insertions, 4 deletions
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 &&