summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-07-18 12:56:58 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-07-18 12:56:58 +0200
commitebb6c9174e0a4622904e8bccd7248609bb66ad8d (patch)
treefb23e76d23efa2976310888bcd58cc56e351fe61 /lib/DBInfoscreen
parent9f8379ef9e60d925a8356a3f0db992806dac4af4 (diff)
show mising realtime data in departure overview as well
Diffstat (limited to 'lib/DBInfoscreen')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 5793ae5..a52a3ce 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -1025,6 +1025,8 @@ sub handle_result {
my $callback = $self->param('callback');
my $via = $self->param('via');
+ my $now = DateTime->now( time_zone => 'Europe/Berlin' );
+
if ( $self->param('ajax') ) {
delete $self->stash->{layout};
}
@@ -1184,6 +1186,12 @@ sub handle_result {
} $result->qos_messages
],
},
+ missingRealtime => (
+ (
+ not $result->has_realtime
+ and $result->start < $now
+ ) ? \1 : \0
+ ),
platform => $result->platform,
route => \@json_route,
scheduledPlatform => $result->sched_platform,
@@ -1255,6 +1263,10 @@ sub handle_result {
station => $result->station,
moreinfo => $moreinfo,
delay => $delay,
+ missing_realtime => (
+ not $result->has_realtime
+ and $result->start < $now ? 1 : 0
+ ),
route_pre => [ $result->route_pre ],
route_post => [ $result->route_post ],
additional_stops => [ $result->additional_stops ],