CC-3351 : Track length should only show to tenths of a second in the library

created a length formatter to use in multiple places.
This commit is contained in:
Naomi Aro 2012-02-24 15:07:04 +01:00
parent 28bb97acfa
commit 19d13889af
14 changed files with 129 additions and 438 deletions

View file

@ -1,5 +1,7 @@
<?php
require_once 'formatters/LengthFormatter.php';
/**
*
* @package Airtime
@ -158,9 +160,15 @@ class Application_Model_Playlist {
$clipSec = Application_Model_Playlist::playlistTimeToSeconds($files[$i]['cliplength']);
//$files[$i]['cliplength'] = Application_Model_Playlist::secondsToPlaylistTime($clipSec);
$offset += $clipSec;
$files[$i]['offset'] = Application_Model_Playlist::secondsToPlaylistTime($offset);
$offset_cliplength = Application_Model_Playlist::secondsToPlaylistTime($offset);
//format the length for UI.
$formatter = new LengthFormatter($files[$i]['cliplength']);
$files[$i]['cliplength'] = $formatter->format();
$formatter = new LengthFormatter($offset_cliplength);
$files[$i]['offset'] = $formatter->format();
$i++;
}