CC-1799 Put Airtime Storage into a Human Readable File Naming Convention

fixing problem with StoredFile::Insert()
This commit is contained in:
Naomi Aro 2011-06-09 12:57:30 +02:00
parent a4b92fe72d
commit 9da314979e
2 changed files with 13 additions and 11 deletions

View File

@ -376,10 +376,6 @@ class ApiController extends Zend_Controller_Action
public function mediaItemStatusAction() {
global $CC_CONFIG;
// disable the view and the layout
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$api_key = $this->_getParam('api_key');
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
{
@ -415,6 +411,7 @@ class ApiController extends Zend_Controller_Action
$md = $this->_getParam('md');
$filepath = $md['MDATA_KEY_FILEPATH'];
$filepath = str_replace("\\", "", $filepath);
$file = StoredFile::RecallByFilepath($filepath);
//New file added to Airtime

View File

@ -389,6 +389,9 @@ class StoredFile {
$file->setDbGunid(md5(uniqid("", true)));
$file->save();
$storedFile = new StoredFile();
$storedFile->_file = $file;
if(isset($md)) {
if (preg_match("/mp3/i", $md['MDATA_KEY_MIME'])) {
$file->setDbFtype("audioclip");
@ -397,12 +400,9 @@ class StoredFile {
$file->setDbFtype("audioclip");
}
$this->setMetadata($md);
$storedFile->setMetadata($md);
}
$storedFile = new StoredFile();
$storedFile->_file = $file;
return $storedFile;
}
@ -444,10 +444,15 @@ class StoredFile {
return null;
}
$storedFile = new StoredFile();
$storedFile->_file = $file;
if (isset($file)) {
$storedFile = new StoredFile();
$storedFile->_file = $file;
return $storedFile;
return $storedFile;
}
else{
return null;
}
}
/**