From 3ac61f8a4e5d40c66dd1a29f6ab768ad87c79940 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 12 Feb 2023 18:35:29 +0100 Subject: Fix route_end handling for arrivals mode --- lib/Travel/Status/DE/HAFAS/Journey.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm index dbe708e..7be8410 100644 --- a/lib/Travel/Status/DE/HAFAS/Journey.pm +++ b/lib/Travel/Status/DE/HAFAS/Journey.pm @@ -166,7 +166,13 @@ sub new { } if ( $journey->{stbStop} ) { - shift(@stops); + if ( $hafas->{arrivals} ) { + $route_end = $stops[0]->{name}; + pop(@stops); + } + else { + shift(@stops); + } } my $ref = { -- cgit v1.2.3