diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-28 22:38:57 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-28 22:38:57 +0200 |
| commit | 827b55f610119d553b965ceb4d3631f0481bbb3b (patch) | |
| tree | df00788440edc234c9d15adc9e49100704675130 /web/sync.go | |
| parent | ff57ebcbe4949b7b53e7c42ecc7916b601a67213 (diff) | |
Rename rides.type to external_sport_type, infer bike type from Strava sport type and display categories in UI
Diffstat (limited to 'web/sync.go')
| -rw-r--r-- | web/sync.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/sync.go b/web/sync.go index 8ed306f..73e8146 100644 --- a/web/sync.go +++ b/web/sync.go @@ -215,12 +215,12 @@ func rideFromActivity(externalID, gpxPath, fitPath string, activity strava.Activ if activityType == "" { activityType = activity.Type } - return ride.StoredRide{ + stored := ride.StoredRide{ ExternalID: externalID, GPXPath: gpxPath, FitPath: fitPath, Name: activity.Name, - Type: activityType, + ExternalSportType: activityType, StartDate: activity.StartDate, DistanceM: activity.DistanceM, ExternalMovingTimeS: activity.MovingTimeS, @@ -228,6 +228,10 @@ func rideFromActivity(externalID, gpxPath, fitPath string, activity strava.Activ TotalElevationGainM: activity.TotalElevationGainM, AverageSpeedMps: activity.AverageSpeedMps, } + if bikeType, ok := ride.BikeTypeForExternalSportType(activityType); ok { + stored.BikeType = bikeType + } + return stored } func skipSyncActivity(progress *SyncProgress, report func(SyncProgress) error, activity strava.Activity, err error) error { |
