hafasBackend: fix transfer type

This commit is contained in:
Leah 2021-02-18 22:38:54 +01:00
parent 4fc48f9a92
commit 2ff5e8936b

View file

@ -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: