From 7c97b1fe6dec381a2382b9f79af5d960c4ffbaf4 Mon Sep 17 00:00:00 2001
From: Jiri Kalvoda <jirikalvoda@kam.mff.cuni.cz>
Date: Thu, 26 Sep 2024 16:58:34 +0200
Subject: [PATCH] FIF OBB next stop
---
Parsers.cs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Parsers.cs b/Parsers.cs
index ab0e249..74a057b 100644
--- a/Parsers.cs
+++ b/Parsers.cs
@@ -413,10 +413,10 @@ class ParserOBBNextStop: Parser
try
{
JsonObject json = JsonObject.Parse(data).AsObject();
- JsonObject nextStop = json["currentStation"].AsObject();
- string nextStopName = nextStop["name"].AsObject()["all"].GetValue<string>();
- DateTime nextStopArrival = DateTime.Parse(nextStop.AsObject()["arrivalForecast"]?.GetValue<string>());
- DateTime nextStopArrivalScheudled = DateTime.Parse(nextStop.AsObject()["arrivalSchedule"]?.GetValue<string>());
+ JsonObject nextStop = json["nextStation"].AsObject();
+ string nextStopName = nextStop["name"].AsObject()["de"].GetValue<string>();
+ DateTime nextStopArrival = DateTime.Parse(nextStop.AsObject()["arrival"].AsObject()["forecast"]?.GetValue<string>());
+ DateTime nextStopArrivalScheudled = DateTime.Parse(nextStop.AsObject()["arrival"].AsObject()["scheduled"]?.GetValue<string>());
long arrivalIn = (long)(nextStopArrival - DateTime.Now).TotalSeconds;
int delay_s = (int)(nextStopArrival - nextStopArrivalScheudled).TotalSeconds;
string delayStr = delay_s==0?"":$" ({TimeShow.WithSign(delay_s)})";
--
GitLab