From d273ecaaee8ddae3bf04016b43f63e2759104890 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 2 Apr 2021 10:09:19 +0200 Subject: skip trains which are likely not in transit yet --- bin/lookup-server | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/lookup-server b/bin/lookup-server index 8305305..d54f03d 100755 --- a/bin/lookup-server +++ b/bin/lookup-server @@ -110,6 +110,9 @@ class Train: ts = stopover["arrival"] if i == 0: + if ts > now and (ts - now).seconds > 300: + # train has not departed from its initial stop yet and is not about to depart + return continue prev_eva = int(self.stopovers[i - 1]["stop"]["id"]) -- cgit v1.2.3