From 3ec4337a153f5d8b380aac8bf8b82d5ffe82ca9d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 7 Apr 2014 15:08:38 +0200 Subject: add line filter (backend only at the moment) --- cgi/index.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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' ) { -- cgit v1.2.3