summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Controller/Stationboard.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-31 00:03:01 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-31 00:03:01 +0200
commite74a1ee61211e6b99ce5e143f2c50edad0815851 (patch)
tree6d208dbf75efebd769a7181e3c179d9af34ceb8c /lib/DBInfoscreen/Controller/Stationboard.pm
parentecd4b4845b95c193a319fa62251328bc6e905f5b (diff)
Handle "delay = cancel"
Diffstat (limited to 'lib/DBInfoscreen/Controller/Stationboard.pm')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 67fd727..758d370 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -273,11 +273,17 @@ sub get_route_timestamps {
};
if ( exists $traindelay->{stations}{$name} ) {
my $delay = $traindelay->{stations}{$name};
- if ( $ret->{$name}{sched_arr} and $delay->{adelay} ) {
+ if ( $ret->{$name}{sched_arr}
+ and $delay->{adelay}
+ and $delay->{adelay} =~ m{^\d+$} )
+ {
$ret->{$name}{rt_arr} = $ret->{$name}{sched_arr}
->clone->add( minutes => $delay->{adelay} );
}
- if ( $ret->{$name}{sched_dep} and $delay->{ddelay} ) {
+ if ( $ret->{$name}{sched_dep}
+ and $delay->{ddelay}
+ and $delay->{ddelay} =~ m{^\d+$} )
+ {
$ret->{$name}{rt_dep} = $ret->{$name}{sched_dep}
->clone->add( minutes => $delay->{ddelay} );
}