From e648d083f898393b92551c3e93721860fb0b6e83 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sat, 27 Jul 2024 10:37:15 +0200 Subject: [PATCH] Refactor convertLineCode --- api/lines.go | 4 ++++ api/schedules.go | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/lines.go b/api/lines.go index 36b3100..2932907 100644 --- a/api/lines.go +++ b/api/lines.go @@ -97,6 +97,10 @@ func convertLineType(old string) string { } } +func convertLineCode(code string) string { + return strings.TrimPrefix(strings.TrimSuffix(code, ":"), "STIF:Line::") +} + func searchLine(t, code string) string { if t == "rer" { for _, line := range IDFMLines { diff --git a/api/schedules.go b/api/schedules.go index f743a96..2aaacaf 100644 --- a/api/schedules.go +++ b/api/schedules.go @@ -82,10 +82,6 @@ type PGSchedule struct { Message string `json:"message"` } -func convertLineCode(code string) string { - return strings.TrimSuffix(code, ":") -} - func getRealTime(code string, stations []string) ([]IDFMMonitoredStopVisit, error) { rurl, err := url.JoinPath(IDFM_BASEURL, "stop-monitoring") if err != nil {