summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-02-12 18:35:29 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-02-12 18:35:29 +0100
commit3ac61f8a4e5d40c66dd1a29f6ab768ad87c79940 (patch)
tree8f957c31f3bcf85a262855320a568b369067282d /lib
parentc2817912d261c625d74d5142e562af67972ce078 (diff)
Fix route_end handling for arrivals mode
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Journey.pm8
1 files changed, 7 insertions, 1 deletions
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 = {