ctucx.git: oeffisearch

[nimlang] fast and simple tripplanner

commit 2ff5e8936bdd6b64b8c41e8337e3eb1dcef001f5
parent 4fc48f9a9218421a6b765499512764d4fcb86086
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 18 Feb 2021 22:38:54 +0100

hafasBackend: fix transfer type
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/backend/hafas/parse/leg.nim b/src/backend/hafas/parse/leg.nim
@@ -35,6 +35,9 @@ proc mkParseLeg*(common: CommonData): proc =
         result.polyline.get.features &= common.polylines[n.getInt()].features
 
     let typeStr = l{"type"}.getStr()
+
+    echo typeStr
+
     if typeStr == "JNY":
       result.direction = some(l{"jny"}{"dirTxt"}.getStr())
       result.tripId = some(l{"jny"}{"jid"}.getStr())

@@ -48,11 +51,11 @@ proc mkParseLeg*(common: CommonData): proc =
       if remarks.len > 0:
         result.remarks = some(remarks.map(mkParseMsg(common)))
 
-    elif typeStr == "WALK" or typeStr == "TRSF":
+    elif typeStr == "WALK":
       result.isWalking = true
       result.distance = some(l{"gis"}{"dist"}.getInt())
 
-    elif typeStr == "DEVI":
+    elif typeStr == "TRSF" or typeStr == "DEVI":
       result.isTransfer = true
 
     else: