summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-12-21 18:56:25 +0100
committerDaniel Friesel <derf@finalrewind.org>2015-12-21 18:56:25 +0100
commit48b4f339e140ad9aadbcd1c016f75456b90c62be (patch)
tree99a5c37a70c09799f195bde5d05c5b81d55ca147
parentd04134a691e2af71105290b120201031933c8b6e (diff)
add offset support for infoscreen frontend
-rw-r--r--index.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/index.pl b/index.pl
index 8aa48b1..ab9f4c1 100644
--- a/index.pl
+++ b/index.pl
@@ -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};