From bf02f1b05042be56ed4ba5a23f4790909ae3329b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 18 Jul 2021 00:05:24 +0200 Subject: show warning if realtime data is missing --- lib/DBInfoscreen/Controller/Stationboard.pm | 6 ++++++ templates/_train_details.html.ep | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index c01d299..b71d6d8 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -679,6 +679,9 @@ sub render_train { } } if ($route_ts) { + if ( $route_ts->{ $result->station }{rt_bogus} ) { + $departure->{missing_realtime} = 1; + } for my $elem ( @{ $departure->{route_pre_diff} }, @{ $departure->{route_post_diff} } @@ -688,6 +691,9 @@ sub render_train { { $elem->{$key} = $route_ts->{ $elem->{name} }{$key}; } + if ( $elem->{rt_bogus} ) { + $departure->{partially_missing_realtime} = 1; + } } } if ( $route_info and @{ $route_info->{messages} // [] } ) { diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index f854279..00b4406 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -131,6 +131,12 @@ % } % for my $link (@{$departure->{links}}) { <%= $link->[0] %> +% } +% if ($departure->{missing_realtime}) { + Echtzeitdaten fehlen +% } +% elsif ($departure->{partially_missing_realtime}) { + Echtzeitdaten unvollständig % } -- cgit v1.2.3