From 24b08c5ab7054753090e1808d48dc828e0ae2eeb Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 19 May 2024 18:21:36 +0200 Subject: EFA: respect rt=1 --- lib/DBInfoscreen/Controller/Stationboard.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index f537064..93388fa 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -360,7 +360,6 @@ sub get_results_p { { $service = $opt{efa}; } - say "EFA $service"; return Travel::Status::DE::EFA->new_p( service => $service, name => $station, @@ -1477,7 +1476,15 @@ sub handle_efa { } for my $result ( $efa->results ) { - my $time = $result->sched_datetime->strftime('%H:%M'); + my $time; + + if ( $show_realtime and $result->rt_datetime ) { + $time = $result->rt_datetime->strftime('%H:%M'); + } + else { + $time = $result->sched_datetime->strftime('%H:%M'); + } + my $linetype = $result->mot_name // 'bahn'; if ( $linetype eq 's-bahn' ) { $linetype = 'sbahn'; @@ -1494,7 +1501,6 @@ sub handle_efa { elsif ( $linetype eq 'sonstige' ) { $linetype = 'ext'; } - say $result->line . " : $linetype"; push( @departures, { -- cgit v1.2.3