From: Andrew Ruthven Date: Sun, 2 Dec 2007 23:54:39 +0000 (+1300) Subject: Time till next recording now handles next_time not being set in a nicer manner. X-Git-Tag: 0.5.3~3 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c1a1b460cfdc4ca0a5a466ca9af05fee0621109;p=mythtv-status.git Time till next recording now handles next_time not being set in a nicer manner. --- diff --git a/bin/mythtv-status b/bin/mythtv-status index 15bb6b5..9a90dc2 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -103,7 +103,7 @@ my %defaults = ( } ); -my $next_time = undef; +my $next_time = 'Never'; # The blocks of output which we might generate. my @blocks = ( @@ -164,7 +164,7 @@ my @blocks = ( if defined $next_time && $next_time eq 'now'; my $date = ParseDate($vars->{'startTime'}); - if (! defined $next_time || Date_Cmp($date, $next_time) < 0) { + if ($next_time eq 'Never' || Date_Cmp($date, $next_time) < 0) { $next_time = $date }; } @@ -187,8 +187,8 @@ my @blocks = ( 'template' => '__next_time__', 'rewrite' => { '&next_time' => sub { - return "Never" - unless defined $next_time; + return $next_time + if $next_time eq 'Never' || $next_time eq 'now'; my $str = Delta_Format(DateCalc('now', $next_time, undef, 1), 0, '%hh Hours, %mv Minutes'); $str =~ s/\b1 (Hour|Minute)s/1 $1/;