From 26ebd3d6442ccb348ff0441a99671f74250ae57b Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 30 Aug 2023 21:54:05 +0200 Subject: [PATCH] API: Expose HAFAS JourneyID, if available (#85) --- lib/Travelynx.pm | 9 +++++---- templates/api_documentation.html.ep | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 39eca59..64a1e85 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -1852,10 +1852,11 @@ sub startup { : undef, }, train => { - type => $status->{train_type}, - line => $status->{train_line}, - no => $status->{train_no}, - id => $status->{train_id}, + type => $status->{train_type}, + line => $status->{train_line}, + no => $status->{train_no}, + id => $status->{train_id}, + hafasId => $status->{extra_data}{trip_id}, }, intermediateStops => [], visibility => { diff --git a/templates/api_documentation.html.ep b/templates/api_documentation.html.ep index 0847139..9c9ee1f 100644 --- a/templates/api_documentation.html.ep +++ b/templates/api_documentation.html.ep @@ -63,6 +63,7 @@ "line" : "6", (Linie als String, nicht immer numerisch, ggf. null)
"no" : "30634", (Fahrtnummer als String, ggf. null oder leer)
"id" : "7512500863736016593" (IRIS- oder HAFAS-spezifische Fahrt-ID)
+ "hafasId" : "1|224479|0|80|30082023" (HAFAS-spezifische Fahrt-ID falls bekannt, ggf. null)
},
"visibility" : {
"desc": "private" / "unlisted" / "followers" / "travelynx" / "public",