mirror of
https://github.com/kaaninchen/Gleiswechsel.git
synced 2026-07-21 19:52:47 +00:00
Fehler beim Überprüfen der Vollständigkeit von den API behoben
This commit is contained in:
+11
-1
@@ -68,7 +68,17 @@ def get_train_info(station, train_ID, train_type):
|
||||
return None
|
||||
|
||||
dep = data.get("departure", [])
|
||||
arrival_iso = dep.get("route_post_diff", [])[-1].get("sched_arr")
|
||||
if not dep:
|
||||
return None
|
||||
|
||||
route_post = dep.get("route_post_diff")
|
||||
if not route_post:
|
||||
return None
|
||||
|
||||
arrival_iso = route_post[-1].get("sched_arr")
|
||||
if not arrival_iso:
|
||||
return None
|
||||
|
||||
return {
|
||||
"arrival": arrival_iso,
|
||||
"operators": dep.get("operators"),
|
||||
|
||||
Reference in New Issue
Block a user