CC-1799 Put Airtime Storage into a Human Readable File Naming Convention
fixing problem with StoredFile::Insert()
This commit is contained in:
parent
a4b92fe72d
commit
9da314979e
|
@ -376,10 +376,6 @@ class ApiController extends Zend_Controller_Action
|
||||||
public function mediaItemStatusAction() {
|
public function mediaItemStatusAction() {
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
|
|
||||||
// disable the view and the layout
|
|
||||||
$this->view->layout()->disableLayout();
|
|
||||||
$this->_helper->viewRenderer->setNoRender(true);
|
|
||||||
|
|
||||||
$api_key = $this->_getParam('api_key');
|
$api_key = $this->_getParam('api_key');
|
||||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
||||||
{
|
{
|
||||||
|
@ -415,6 +411,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
$md = $this->_getParam('md');
|
$md = $this->_getParam('md');
|
||||||
$filepath = $md['MDATA_KEY_FILEPATH'];
|
$filepath = $md['MDATA_KEY_FILEPATH'];
|
||||||
$filepath = str_replace("\\", "", $filepath);
|
$filepath = str_replace("\\", "", $filepath);
|
||||||
|
|
||||||
$file = StoredFile::RecallByFilepath($filepath);
|
$file = StoredFile::RecallByFilepath($filepath);
|
||||||
|
|
||||||
//New file added to Airtime
|
//New file added to Airtime
|
||||||
|
|
|
@ -389,6 +389,9 @@ class StoredFile {
|
||||||
$file->setDbGunid(md5(uniqid("", true)));
|
$file->setDbGunid(md5(uniqid("", true)));
|
||||||
$file->save();
|
$file->save();
|
||||||
|
|
||||||
|
$storedFile = new StoredFile();
|
||||||
|
$storedFile->_file = $file;
|
||||||
|
|
||||||
if(isset($md)) {
|
if(isset($md)) {
|
||||||
if (preg_match("/mp3/i", $md['MDATA_KEY_MIME'])) {
|
if (preg_match("/mp3/i", $md['MDATA_KEY_MIME'])) {
|
||||||
$file->setDbFtype("audioclip");
|
$file->setDbFtype("audioclip");
|
||||||
|
@ -397,12 +400,9 @@ class StoredFile {
|
||||||
$file->setDbFtype("audioclip");
|
$file->setDbFtype("audioclip");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setMetadata($md);
|
$storedFile->setMetadata($md);
|
||||||
}
|
}
|
||||||
|
|
||||||
$storedFile = new StoredFile();
|
|
||||||
$storedFile->_file = $file;
|
|
||||||
|
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,10 +444,15 @@ class StoredFile {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$storedFile = new StoredFile();
|
if (isset($file)) {
|
||||||
$storedFile->_file = $file;
|
$storedFile = new StoredFile();
|
||||||
|
$storedFile->_file = $file;
|
||||||
|
|
||||||
return $storedFile;
|
return $storedFile;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue