From 70e5347878d5a48d58c715cbaf74c670617ada48 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 23 Oct 2022 20:17:58 +0200 Subject: [PATCH] Keep compta with Pierre Grimaud API --- api/lines.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/lines.go b/api/lines.go index 079a79e..eecca5a 100644 --- a/api/lines.go +++ b/api/lines.go @@ -99,6 +99,13 @@ func convertLineType(old string) string { func convertCode(t, code string) string { if !strings.HasPrefix(code, "line:IDFM:") { + if t == "tram" && !strings.HasPrefix(code, "T") { + code = "T" + code + } + if t == "noctilien" && !strings.HasPrefix(code, "N") { + code = "N" + code + } + if len(code) != 6 || !strings.HasPrefix(code, "C") { code = searchLine(t, code) }