ctucx.git: oeffisearch

[nimlang] fast and simple tripplanner

commit cb2fcc16dda85fcfc044501ef35bcf8ebdc41bf9
parent da59b69e9dd4a9fee76f25451e5395a827c10937
Author: Leah Thein <leah@toaster.fritz.box>
Date: Tue, 24 Nov 2020 23:26:08 +0100

fixes connecttion: Moskva Iaroslavskaja -> Vladivostok
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/backend/hafas/parse/line.nim b/src/backend/hafas/parse/line.nim
@@ -37,7 +37,12 @@ proc parseLine*(common: CommonData, i: int): Option[Line] =
   res.name = line.name
   res.product = parseProduct(line.cls)
   res.tripNum = line.prodCtx.num
-  res.productName = line.prodCtx.catOut
+
+  if not isNone(line.prodCtx.catOut):
+    res.productName = get(line.prodCtx.catOut)
+  else:
+    res.productName = "?"
+
   res.fullProductName = line.prodCtx.catOutL
   res.id = slug(line.prodCtx.lineId.get(line.name))
 
diff --git a/src/backend/hafas/types.nim b/src/backend/hafas/types.nim
@@ -31,7 +31,7 @@ type
   HafasProdCtx* = object
     name*:     string
     num*:      string
-    catOut*:   string
+    catOut*:   Option[string]
     catOutL*:  string
     lineId*:   Option[string]