summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/index.pl9
-rw-r--r--lib/App/VRR/Fakedisplay.pm.PL2
2 files changed, 9 insertions, 2 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index edb112d..27d0fb1 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -11,7 +11,7 @@ use Travel::Status::DE::VRR;
no warnings 'uninitialized';
-our $VERSION = '0.05';
+our $VERSION = '0.06';
my %default = (
backend => 'vrr',
@@ -152,6 +152,7 @@ sub render_image {
my ( @grep_line, @grep_platform );
my $offset = 0;
+ my $displayed_lines = 0;
my ( $results, $errstr ) = get_results( $backend, $city, $stop );
@@ -258,6 +259,7 @@ sub render_image {
$png->draw_at( 0, $line );
$png->draw_at( 25, $destination );
+ $displayed_lines++;
if ( length($etr) > 2 ) {
$png->draw_at( 145, $etr );
@@ -275,6 +277,11 @@ sub render_image {
$png->new_line();
}
+ if ($displayed_lines == 0) {
+ $png->new_line();
+ $png->new_line();
+ $png->draw_at(50, 'no departures');
+ }
$self->render( data => $png->png );
}
diff --git a/lib/App/VRR/Fakedisplay.pm.PL b/lib/App/VRR/Fakedisplay.pm.PL
index 59d0561..e60c8ff 100644
--- a/lib/App/VRR/Fakedisplay.pm.PL
+++ b/lib/App/VRR/Fakedisplay.pm.PL
@@ -82,7 +82,7 @@ use utf8;
use File::ShareDir qw(dist_file);
use GD;
-our $VERSION = '0.04';
+our $VERSION = '0.06';
sub new {
my ( $class, %opt ) = @_;