This commit is contained in:
Rudi Grinberg 2012-09-18 11:46:35 -04:00
parent 018b50d316
commit 6fc0d50c9f
1 changed files with 11 additions and 11 deletions

View File

@ -21,9 +21,9 @@ class AudiopreviewController extends Zend_Controller_Action
{ {
global $CC_CONFIG; global $CC_CONFIG;
$audioFileID = $this->_getParam('audioFileID'); $audioFileID = $this->_getParam('audioFileID');
$audioFileArtist = $this->_getParam('audioFileArtist'); $audioFileArtist = $this->_getParam('audioFileArtist');
$audioFileTitle = $this->_getParam('audioFileTitle'); $audioFileTitle = $this->_getParam('audioFileTitle');
$type = $this->_getParam('type'); $type = $this->_getParam('type');
$request = $this->getRequest(); $request = $this->getRequest();
@ -47,23 +47,23 @@ class AudiopreviewController extends Zend_Controller_Action
} }
if ($type == "audioclip") { if ($type == "audioclip") {
$uri = "/api/get-media/file/".$audioFileID; $uri = "/api/get-media/file/".$audioFileID;
$media = Application_Model_StoredFile::Recall($audioFileID); $media = Application_Model_StoredFile::Recall($audioFileID);
$mime = $media->getPropelOrm()->getDbMime(); $mime = $media->getPropelOrm()->getDbMime();
} elseif ($type == "stream") { } elseif ($type == "stream") {
$webstream = CcWebstreamQuery::create()->findPk($audioFileID); $webstream = CcWebstreamQuery::create()->findPk($audioFileID);
$uri = $webstream->getDbUrl(); $uri = $webstream->getDbUrl();
$mime = $webstream->getDbMime(); $mime = $webstream->getDbMime();
} else { } else {
throw new Exception("Unknown type for audio preview!.Type=$type"); throw new Exception("Unknown type for audio preview!.Type=$type");
} }
$this->view->uri = $uri; $this->view->uri = $uri;
$this->view->mime = $mime; $this->view->mime = $mime;
$this->view->audioFileID = $audioFileID; $this->view->audioFileID = $audioFileID;
$this->view->audioFileArtist = $audioFileArtist; $this->view->audioFileArtist = $audioFileArtist;
$this->view->audioFileTitle = $audioFileTitle; $this->view->audioFileTitle = $audioFileTitle;
$this->view->type = $type; $this->view->type = $type;
$this->_helper->viewRenderer->setRender('audio-preview'); $this->_helper->viewRenderer->setRender('audio-preview');
} }