diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-12-21 18:56:25 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-12-21 18:56:25 +0100 |
commit | 48b4f339e140ad9aadbcd1c016f75456b90c62be (patch) | |
tree | 99a5c37a70c09799f195bde5d05c5b81d55ca147 | |
parent | d04134a691e2af71105290b120201031933c8b6e (diff) |
add offset support for infoscreen frontend
-rw-r--r-- | index.pl | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -262,10 +262,12 @@ sub get_filtered_departures { my $time = $d->time; my $etr; + # Note: The offset / countdown check does not yet take caching + # into account, so it may be off by up to cache_expiry seconds. if ( ( @grep_line and not( any { $line =~ $_ } @grep_line ) ) or ( @grep_platform and not( $platform ~~ \@grep_platform ) ) or ( $opt{hide_regional} and $line =~ m{ ^ (RB | RE | IC | EC) }x ) - ) + or ( $opt{offset} and $d->countdown < $opt{offset} ) ) { next; } @@ -391,6 +393,7 @@ sub render_html { filter_line => scalar $self->param('line'), filter_platform => scalar $self->param('platform'), hide_regional => ( $template eq 'infoscreen' ? 0 : 1 ), + offset => scalar $self->param('offset'), ); my @departures = make_infoboard_lines( @@ -435,6 +438,7 @@ sub render_json { filter_line => scalar $self->param('line'), filter_platform => scalar $self->param('platform'), hide_regional => 0, + offset => scalar $self->param('offset'), ); my $raw_departures = $data->{filtered_results}; my $errstr = $data->{errstr}; @@ -477,6 +481,7 @@ sub render_image { filter_line => scalar $self->param('line'), filter_platform => scalar $self->param('platform'), hide_regional => 0, + offset => scalar $self->param('offset'), ); my $raw_departures = $data->{filtered_results}; my $errstr = $data->{errstr}; |