diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index bc2f054..9efe0c3 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -260,6 +260,13 @@ sub handle_request {  		$opt{with_related} = 1;  	} +	if ($self->param('train')) { +		# request results from five minutes ago to avoid train details suddenly +		# becoming unavailable when its scheduled departure is reached. +		$opt{datetime} = DateTime->now(time_zone => 'Europe/Berlin')->subtract(minutes => 20); +		$opt{lookahead} = 200; +	} +  	my $data   = get_results_for( $backend, $station, %opt );  	my $errstr = $data->{errstr}; @@ -654,6 +661,9 @@ sub train_details {  	$self->stash( title      => 'DBF' );  	$self->stash( version    => $dbf_version ); +	$opt{datetime} = DateTime->now(time_zone => 'Europe/Berlin')->subtract(minutes => 20); +	$opt{lookahead} = 200; +  	my $data   = get_results_for( 'iris', $station, %opt );  	my $errstr = $data->{errstr}; | 
