Julian's bug report:
Hello Andrew!
I noticed a bizarre behaviour of mythtv-status: at 9pm, when the next
recording was due at about 6pm the next day, it reported: "Next
Recording In: -3 Hours, -7 Minutes", which is clearly nonsense. The
attached patch fixes this, and two other bugs:
- if the next recording is in longer than 1 day, it now gives the
correct time
- if the time is 1 Hour, 1 Minute, it says this correctly (instead of
saying 1 Hour, 1 Minutes)
if $next_time eq 'Never' || $next_time eq 'now';
my $err;
- my $delta = DateCalc('now', $next_time, \$err, 1);
+ my $delta = DateCalc('now', $next_time, \$err, 0);
my $str = Delta_Format($delta, 0, '%hh Hours, %mv Minutes');
- my $seconds = Delta_Format($delta, 0, '%sh');
+ my $seconds = Delta_Format($delta, 'approx', 0, '%sh');
- $str =~ s/\b1 (Hour|Minute)s/1 $1/;
+ $str =~ s/\b1 (Hour|Minute)s/1 $1/g;
$str =~ s/^0 Hours, //;
$str =~ s/ 0 Minutes//;