summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-10-16 18:37:36 +0200
committerDaniel Friesel <derf@finalrewind.org>2013-10-16 18:37:36 +0200
commit6917fea6ee94a4dfca25a7b58541e12f34422d03 (patch)
tree9229413c42baa3b657b358a85e10a05251ed6b69
parenta9eee385a519f90faf8f89f5612fb91094e0ce97 (diff)
do not filter cancelled departures from json
-rwxr-xr-xBuild.PL4
-rw-r--r--cgi/index.pl17
2 files changed, 9 insertions, 12 deletions
diff --git a/Build.PL b/Build.PL
index ad3cc07..f690af6 100755
--- a/Build.PL
+++ b/Build.PL
@@ -25,8 +25,8 @@ Module::Build->new(
'DateTime::Format::Strptime' => 0,
'GD' => 0,
'Mojolicious::Lite' => 0,
- 'Travel::Status::DE::DeutscheBahn' => 1.00,
- 'Travel::Status::DE::VRR' => 0.02,
+ 'Travel::Status::DE::DeutscheBahn' => 1.01,
+ 'Travel::Status::DE::VRR' => 1.04,
},
sign => 1,
dist_version_from => 'cgi/index.pl',
diff --git a/cgi/index.pl b/cgi/index.pl
index 8ddd0b9..05b0aa4 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -78,9 +78,10 @@ sub handle_request {
my $frontend = $self->param('frontend') // 'png';
my $errstr;
- if ($city and $stop) {
- (undef, $errstr) = get_results( $self->param('backend') // $default{backend},
- $city, $stop);
+ if ( $city and $stop ) {
+ ( undef, $errstr )
+ = get_results( $self->param('backend') // $default{backend},
+ $city, $stop );
}
if ( not $no_lines or $no_lines < 1 or $no_lines > 40 ) {
@@ -181,12 +182,6 @@ sub get_filtered_departures {
next;
}
- if ( $d->delay eq '-9999' ) {
-
- # canceled
- next;
- }
-
push( @filtered_results, $d );
}
@@ -231,7 +226,9 @@ sub make_infoboard_lines {
// $strp_simple->parse_datetime($time);
my $dt;
- if ( $displayed_lines >= $no_lines ) {
+ if ( ( $displayed_lines >= $no_lines )
+ or $d->is_cancelled )
+ {
next;
}