From 11b153dd92382c94e4af30fa777f77b3737cab57 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 11 Dec 2022 16:19:24 +0100 Subject: handle "Betriebsstelle nicht bekannt" in routes --- lib/DBInfoscreen/Controller/Stationboard.pm | 8 ++++++++ lib/DBInfoscreen/Helper/HAFAS.pm | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 36f62d7..c02a342 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -748,6 +748,14 @@ sub render_train { @{ $departure->{route_post_diff} } ) { + if ( $elem->{name} + =~ m{^Betriebsstelle nicht bekannt (\d+)$} ) + { + my $eva = $1; + if ( $route_ts->{$eva} ) { + $elem->{name} = $route_ts->{$eva}{name}; + } + } for my $key ( keys %{ $route_ts->{ $elem->{name} } // {} } ) { $elem->{$key} = $route_ts->{ $elem->{name} }{$key}; diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm index 6af47e3..a6769aa 100644 --- a/lib/DBInfoscreen/Helper/HAFAS.pm +++ b/lib/DBInfoscreen/Helper/HAFAS.pm @@ -217,7 +217,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 => $stop->{sched_arr}, sched_dep => $stop->{sched_dep}, rt_arr => $stop->{rt_arr}, -- cgit v1.2.3