ctucx.git: nimhafas

[nimlang] hafas-client library

commit 4a4a0d3d4ae86aa9245a9c79bba1f80811407ba5
parent 1909376e6c33d9b5c1f56139fe53e6866692dde0
Author: Leah (ctucx) <git@ctu.cx>
Date: Wed, 11 Jan 2023 22:34:08 +0100

remove train-types fetch
1 file changed, 0 insertions(+), 13 deletions(-)
M
nimhafas/parse/line.nim
|
13
-------------
diff --git a/nimhafas/parse/line.nim b/nimhafas/parse/line.nim
@@ -11,19 +11,6 @@ import asyncdispatch
 var trainTypes = initTable[string, string]()
 var trainTypesShort = initTable[string, string]()
 
-proc fetchTrainTypes() {.async.} =
-  var client = newAsyncHttpClient()
-  let resp = await client.getContent("https://lib.finalrewind.org/dbdb/ice_type.json")
-  let data = parseJson(resp)
-  for key, info in pairs(data):
-    if info{"type"}.getStr != "" and info{"type"}.getStr != "EC" and info{"type"}.getStr != "IC":
-      trainTypes[key] = info{"type"}.getStr
-    if info{"short"}.getStr != "":
-      trainTypesShort[key] = info{"short"}.getStr
-
-asyncCheck fetchTrainTypes()
-
-
 proc parseLine*(common: CommonData, i: int): Option[Line] =
   let l = common.lines[i]