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

@ -52,10 +52,12 @@ class PlaylistController extends Zend_Controller_Action
private function createUpdateResponse($pl)
{
$formatter = new LengthFormatter($pl->getLength());
$this->view->length = $formatter->format();
$this->view->pl = $pl;
$this->view->html = $this->view->render('playlist/update.phtml');
$this->view->name = $pl->getName();
$this->view->length = $pl->getLength();
$this->view->description = $pl->getDescription();
$this->view->modified = $pl->getLastModified("U");
@ -65,6 +67,9 @@ class PlaylistController extends Zend_Controller_Action
private function createFullResponse($pl = null)
{
if (isset($pl)) {
$formatter = new LengthFormatter($pl->getLength());
$this->view->length = $formatter->format();
$this->view->pl = $pl;
$this->view->id = $pl->getId();
$this->view->html = $this->view->render('playlist/index.phtml');
@ -114,6 +119,9 @@ class PlaylistController extends Zend_Controller_Action
if (isset($this->pl_sess->id)) {
$pl = new Application_Model_Playlist($this->pl_sess->id);
$this->view->pl = $pl;
$formatter = new LengthFormatter($pl->getLength());
$this->view->length = $formatter->format();
}
}
catch (PlaylistNotFoundException $e) {