CC-4211: Smart Playlist: length of dynamic block wont be convert to hh:mm:ss if set limit as float number, such as 23.999

- fixed
This commit is contained in:
James 2012-08-13 11:59:28 -04:00
parent 1e36d77857
commit db3a9357f9
1 changed files with 11 additions and 4 deletions

View File

@ -275,17 +275,24 @@ EOT;
if ($modifier == "items") { if ($modifier == "items") {
$length = $value." ".$modifier; $length = $value." ".$modifier;
} else { } else {
$value = str_pad($value, 2, "0", STR_PAD_LEFT); $hour = "00";
if ($modifier == "minutes") { if ($modifier == "minutes") {
$hour = "00";
if ($value >59) { if ($value >59) {
$hour = intval($value/60); $hour = intval($value/60);
$value = $value%60; $value = $value%60;
} }
$length = $hour.":".$value.":00";
} else if ($modifier == "hours") { } else if ($modifier == "hours") {
$length = $value.":00:00"; $mins = $value * 60;
if ($mins >59) {
$hour = intval($mins/60);
$hour = str_pad($hour, 2, "0", STR_PAD_LEFT);
$value = $mins%60;
}
} }
$hour = str_pad($hour, 2, "0", STR_PAD_LEFT);
$value = str_pad($value, 2, "0", STR_PAD_LEFT);
$length = $hour.":".$value.":00";
} }
return $length; return $length;
} }