Corrected patch from Message #10: should have null Minutes field when 0
*** /usr/bin/mythtv-status 2017-01-25 15:17:10.000000000 -0500 --- mythtv-status 2018-10-21 17:23:07.716212366 -0400 *************** *** 466,484 **** my $err; my $delta = DateCalc($c->{'date'} || 'now', $next_time, \$err, 1); my $seconds = Delta_Format($delta, 'approx', 0, '%sh'); ! # If the next recording is more than 1 day in the future, ! # print out the days and hours. ! my $str; ! if ($seconds > 24 * 3600) { ! $str = Delta_Format($delta, 0, '%dh Days, %hv Hours'); ! } else { ! $str = Delta_Format($delta, 0, '%hh Hours, %mv Minutes'); ! } ! $str =~ s/\b1 (Day|Hour|Minute)s/1 $1/g; - $str =~ s/\b0 (Days|Hours)(, )?//; - $str =~ s/, 0 Minutes$//; if ($seconds <= $c->{'recording_in_warn'}) { $warn_present ||= 1; --- 466,485 ---- my $err; my $delta = DateCalc($c->{'date'} || 'now', $next_time, \$err, 1); my $seconds = Delta_Format($delta, 'approx', 0, '%sh'); + my $nxtsec = $seconds; ! # Days, hours, Min output. ! if ($nxtsec > 24 * 3600) { ! $str = sprintf("%d Days, ", $nxtsec/24/3600); ! $nxtsec = $nxtsec % (24 *3600); ! } ! if ($nxtsec > 3600) { ! $str .= sprintf("%d Hours, ", $nxtsec/3600); ! $nxtsec = $nxtsec % 3600; ! } ! $str .= sprintf("%d Minutes", $nxtsec/60 if (int($nxtsec/60) > 0); ! $str =~ s/, $//; $str =~ s/\b1 (Day|Hour|Minute)s/1 $1/g; if ($seconds <= $c->{'recording_in_warn'}) { $warn_present ||= 1;