summaryrefslogtreecommitdiff
path: root/web/views.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-16 14:55:26 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-16 14:55:26 +0200
commitdf7c9b5130ba193fc918a947a461f2a70dc2dd3c (patch)
tree0366e0b60338e268d758511621b9adf721be8322 /web/views.go
parent53ab332e6d2afe9818914e0026310e4cadcc4202 (diff)
fix(web): use Cotacol for climb difficulty
Diffstat (limited to 'web/views.go')
-rw-r--r--web/views.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/web/views.go b/web/views.go
index f8a45d3..551a74f 100644
--- a/web/views.go
+++ b/web/views.go
@@ -68,7 +68,6 @@ type RideProfileClimb struct {
TopKm float64 `json:"topKm"`
TopElevationM float64 `json:"topElevationM"`
Name string `json:"name"`
- Score float64 `json:"score"`
Category string `json:"category"`
DistanceKm float64 `json:"distanceKm"`
SlopePercent float64 `json:"slopePercent"`
@@ -269,7 +268,6 @@ func buildRideProfile(parsed ride.Ride, passes []mountain_pass.MountainPass, off
TopKm: segment.TopDistanceM() / 1000,
TopElevationM: segment.TopElevationM(),
Name: analyzedClimb.Name,
- Score: analyzedClimb.Score,
Category: analyzedClimb.Category,
DistanceKm: analyzedClimb.DistanceM / 1000,
SlopePercent: analyzedClimb.SlopePercent,
@@ -327,16 +325,16 @@ func formatElevation(meters float64) string {
return fmt.Sprintf("%.0f m", meters)
}
-func formatCotacol(score float64) string {
- return fmt.Sprintf("%.1f", score)
+func formatCotacol(cotacol float64) string {
+ return fmt.Sprintf("%.1f", cotacol)
}
-func formatCotacolPer100Km(score, distanceM float64) string {
+func formatCotacolPer100Km(cotacol, distanceM float64) string {
distanceKm := distanceM / 1000
if distanceKm <= 0 {
return "-"
}
- return fmt.Sprintf("%.1f", score*100/distanceKm)
+ return fmt.Sprintf("%.1f", cotacol*100/distanceKm)
}
func formatRouteIndex(index int) string {