From d6ecbb7b760366225d776d57c714efebad083f3e Mon Sep 17 00:00:00 2001 From: Jo Vandeginste Date: Mon, 15 Apr 2024 16:08:30 +0200 Subject: [PATCH] Add "Garmin" to the list of correct altitude creators Signed-off-by: Jo Vandeginste --- pkg/database/workouts_map.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/database/workouts_map.go b/pkg/database/workouts_map.go index 642780a6..3cda222b 100644 --- a/pkg/database/workouts_map.go +++ b/pkg/database/workouts_map.go @@ -2,6 +2,7 @@ package database import ( "math" + "slices" "time" "github.com/codingsince1985/geo-golang" @@ -13,8 +14,14 @@ import ( var online = true +var correctAltitudeCreators = []string{ + "Garmin", "Garmin Connect", + "Apple Watch", + "StravaGPX iPhone", "StravaGPX", +} + func creatorNeedsCorrection(creator string) bool { - return creator != "Garmin Connect" && creator != "Apple Watch" && creator != "StravaGPX iPhone" && creator != "StravaGPX" + return !slices.Contains(correctAltitudeCreators, creator) } func normalizeDegrees(val float64) float64 {