aboutsummaryrefslogtreecommitdiff
path: root/ride/category.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-28 22:38:57 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-28 22:38:57 +0200
commit827b55f610119d553b965ceb4d3631f0481bbb3b (patch)
treedf00788440edc234c9d15adc9e49100704675130 /ride/category.go
parentff57ebcbe4949b7b53e7c42ecc7916b601a67213 (diff)
Rename rides.type to external_sport_type, infer bike type from Strava sport type and display categories in UI
Diffstat (limited to 'ride/category.go')
-rw-r--r--ride/category.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/ride/category.go b/ride/category.go
index 6a3431c..3f6cf89 100644
--- a/ride/category.go
+++ b/ride/category.go
@@ -7,6 +7,17 @@ const (
BikeTypeMTB BikeType = "mtb"
)
+func BikeTypeForExternalSportType(value string) (BikeType, bool) {
+ switch value {
+ case "Ride":
+ return BikeTypeRoad, true
+ case "MountainBikeRide":
+ return BikeTypeMTB, true
+ default:
+ return "", false
+ }
+}
+
type RideType string
const (