summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-04-07 15:08:38 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-04-07 15:08:38 +0200
commit3ec4337a153f5d8b380aac8bf8b82d5ffe82ca9d (patch)
tree886c0b3ace332eb72bee3fa476b5c624a8ec77ed
parentcc3ef2ab672b1bdf1ed0bc1a921ef355f34b1415 (diff)
add line filter (backend only at the moment)
-rw-r--r--cgi/index.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index 4134e4e..7d5282f 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -43,6 +43,7 @@ sub handle_request {
my $via = $self->stash('via');
my @platforms = split( /,/, $self->param('platforms') // q{} );
+ my @lines = split( /,/, $self->param('lines') // q{} );
my $template = $self->param('mode') // 'multi';
my $hide_low_delay = $self->param('hidelowdelay') // 0;
my $hide_opts = $self->param('hide_opts') // 0;
@@ -88,7 +89,8 @@ sub handle_request {
for my $result (@results) {
my $platform = ( split( / /, $result->platform ) )[0];
- my $delay = 0;
+ my $line = $result->line;
+ my $delay = 0;
if ($via) {
my @route = $result->route;
if ( not( any { $_ =~ m{$via}io } @route ) ) {
@@ -98,6 +100,9 @@ sub handle_request {
if ( @platforms and not( any { $_ eq $platform } @platforms ) ) {
next;
}
+ if ( @lines and not( any { $line =~ m{^$_} } @lines ) ) {
+ next;
+ }
my $info = $result->info;
if ( $info eq '+0' ) {