CC-1799 Put Airtime Storage into a Human Readable File Naming Convention
delete is working, can upload from plupload.
This commit is contained in:
parent
8a15144dc8
commit
84dd5dac62
4 changed files with 73 additions and 80 deletions
|
@ -440,6 +440,19 @@ class ApiController extends Zend_Controller_Action
|
|||
$file->setMetadata($md);
|
||||
}
|
||||
}
|
||||
else if ($mode == "delete") {
|
||||
$filepath = $md['MDATA_KEY_FILEPATH'];
|
||||
$filepath = str_replace("\\", "", $filepath);
|
||||
$file = StoredFile::RecallByFilepath($filepath);
|
||||
|
||||
if (is_null($file)) {
|
||||
$this->view->error = "File doesn't exist in Airtime.";
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$file->delete();
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->id = $file->getId();
|
||||
}
|
||||
|
|
|
@ -259,19 +259,16 @@ class StoredFile {
|
|||
*/
|
||||
public function delete()
|
||||
{
|
||||
if (!$this->exists()) {
|
||||
return PEAR::raiseError('File does not exist.');
|
||||
}
|
||||
|
||||
if ($this->getFormat() == 'audioclip') {
|
||||
$res = $this->deleteFile();
|
||||
if (PEAR::isError($res)) {
|
||||
return $res;
|
||||
if ($this->exists()) {
|
||||
if ($this->getFormat() == 'audioclip') {
|
||||
$res = $this->deleteFile();
|
||||
if (PEAR::isError($res)) {
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Playlist::DeleteFileFromAllPlaylists($this->getId());
|
||||
|
||||
$this->_file->delete();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue