my $err;
my $delta = DateCalc($c->{'date'} || 'now', $next_time, \$err, 1);
my $seconds = Delta_Format($delta, 'approx', 0, '%sh');
+ my $remsec = $seconds; # Remaining seconds
+ my $str = '';
- # 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');
+ # Days
+ if ($remsec > 24 * 3600) {
+ $str = sprintf("%d Days, ", $remsec / 24 / 3600);
+ $remsec = $remsec % (24 * 3600);
}
-
+ # Hours
+ if ($remsec > 3600) {
+ $str .= sprintf("%d Hours, ", $remsec / 3600);
+ $remsec = $remsec % 3600;
+ }
+ # Minutes
+ if ($remsec > 60) {
+ $str .= sprintf("%d Minutes", $remsec / 60);
+ }
+ # Clean up the string.
+ $str =~ s/, $//;
$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;
mythtv-status (0.10.8-1.1) UNRELEASED; urgency=medium
- * New upstream release.
+ * New upstream release (Closes #853857).
-- Andrew Ruthven <andrew@etc.gen.nz> Mon, 12 Nov 2018 23:19:17 +1300