Commit c4af6574 authored by Mike Sheldon's avatar Mike Sheldon

Make sure the track duration is set before reformating it

parent 52798a73
......@@ -59,12 +59,14 @@ foreach($res as &$trow) {
}
}
// Give the duration in MM:SS
$mins = floor($track->duration / 60);
$sec = floor($track->duration % 60);
if (strlen($sec) == 1) { $sec = "0" . $sec; }
$duration = $mins . ":" . $sec;
$smarty->assign('duration', $duration);
if($track->duration) {
// Give the duration in MM:SS
$mins = floor($track->duration / 60);
$sec = floor($track->duration % 60);
if (strlen($sec) == 1) { $sec = "0" . $sec; }
$duration = $mins . ":" . $sec;
$smarty->assign('duration', $duration);
}
$smarty->assign('albums', $aOtherAlbums);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment