From fc9562f7901deb04afb548f9a02a314f4e1dc27a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 12 Dec 2022 18:20:40 +0100 Subject: Improve "Betriebsstelle nicht bekannt" handling --- lib/Travelynx.pm | 8 ++++++++ lib/Travelynx/Helper/HAFAS.pm | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 4195001..046f947 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -1034,6 +1034,14 @@ sub startup { my ( $route_data, $journey, $polyline ) = @_; for my $station ( @{$route} ) { + if ( $station->[0] + =~ m{^Betriebsstelle nicht bekannt (\d+)$} ) + { + my $eva = $1; + if ( $route_data->{$eva} ) { + $station->[0] = $route_data->{$eva}{name}; + } + } $station->[1] = $route_data->{ $station->[0] }; } diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm index 6d2f6d2..4899a68 100644 --- a/lib/Travelynx/Helper/HAFAS.pm +++ b/lib/Travelynx/Helper/HAFAS.pm @@ -124,7 +124,9 @@ sub get_route_timestamps_p { my $station_is_past = 1; for my $stop ( $journey->route ) { my $name = $stop->{name}; - $ret->{$name} = { + $ret->{$name} = $ret->{ $stop->{eva} } = { + name => $stop->{name}, + eva => $stop->{eva}, sched_arr => _epoch( $stop->{sched_arr} ), sched_dep => _epoch( $stop->{sched_dep} ), rt_arr => _epoch( $stop->{rt_arr} ), -- cgit v1.2.3