Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Airtime into cc-5709-airtime-analyzer
This commit is contained in:
commit
f120caa093
3 changed files with 25 additions and 1 deletions
|
@ -158,7 +158,8 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
//our internal schema. Internally, file path is stored relative to a directory, with the directory
|
||||
//as a foreign key to cc_music_dirs.
|
||||
if ($requestData["full_path"]) {
|
||||
|
||||
Application_Model_Preference::updateDiskUsage(filesize($requestData["full_path"]));
|
||||
|
||||
$fullPath = $requestData["full_path"];
|
||||
$storDir = Application_Model_MusicDir::getStorDir()->getDirectory();
|
||||
$pos = strpos($fullPath, $storDir);
|
||||
|
@ -198,6 +199,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$file = CcFilesQuery::create()->findPk($id);
|
||||
if ($file) {
|
||||
$storedFile = Application_Model_StoredFile($file);
|
||||
Application_Model_Preference::updateDiskUsage(-1 * abs(filesize($storedFile->getFilePath())));
|
||||
$storedFile->delete(); //TODO: This checks your session permissions... Make it work without a session?
|
||||
$file->delete();
|
||||
$this->getResponse()
|
||||
|
@ -375,5 +377,6 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue