From 30df90e0617e26b680f37f21696781118974bf22 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 5 Feb 2023 12:39:33 +0100 Subject: hafas: show cancellation in detail page --- lib/DBInfoscreen/Controller/Stationboard.pm | 2 ++ lib/DBInfoscreen/Helper/HAFAS.pm | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 39b3a3d..04b0ba3 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1183,6 +1183,8 @@ sub train_details { = $station_info->{arr_cancelled}; $res->{departure_is_cancelled} = $station_info->{dep_cancelled}; + $res->{is_cancelled} = $res->{arrival_is_cancelled} + || $res->{arrival_is_cancelled}; } } diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm index 6111a5b..ec5c051 100644 --- a/lib/DBInfoscreen/Helper/HAFAS.pm +++ b/lib/DBInfoscreen/Helper/HAFAS.pm @@ -232,16 +232,18 @@ sub get_route_timestamps_p { for my $stop ( $journey->route ) { my $name = $stop->{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}, - rt_dep => $stop->{rt_dep}, - arr_delay => $stop->{arr_delay}, - dep_delay => $stop->{dep_delay}, - load => $stop->{load}, - isCancelled => ( + name => $stop->{name}, + eva => $stop->{eva}, + sched_arr => $stop->{sched_arr}, + sched_dep => $stop->{sched_dep}, + rt_arr => $stop->{rt_arr}, + rt_dep => $stop->{rt_dep}, + arr_delay => $stop->{arr_delay}, + dep_delay => $stop->{dep_delay}, + arr_cancelled => $stop->{arr_cancelled}, + dep_cancelled => $stop->{dep_cancelled}, + load => $stop->{load}, + isCancelled => ( ( $stop->{arr_cancelled} or not $stop->{sched_arr} ) and ( $stop->{dep_cancelled} or not $stop->{sched_dep} ) -- cgit v1.2.3