CC-5709: Airtime Analyzer

* Some cleanup and refactoring for file deletion in the Media REST API
* Fix the refresh timer on the Add Media page when there's pending
  imports.
This commit is contained in:
Albert Santoni 2014-03-24 17:14:04 -04:00
parent 6952902b22
commit db2b52a1bf
5 changed files with 35 additions and 8 deletions

View file

@ -198,8 +198,9 @@ class Rest_MediaController extends Zend_Rest_Controller
if ($file) {
$con = Propel::getConnection();
$storedFile = new Application_Model_StoredFile($file, $con);
Application_Model_Preference::updateDiskUsage(-1 * abs(filesize($storedFile->getFilePath())));
$storedFile->delete(); //TODO: This checks your session permissions... Make it work without a session?
if ($storedFile->existsOnDisk()) {
$storedFile->delete(); //TODO: This checks your session permissions... Make it work without a session?
}
$file->delete();
$this->getResponse()
->setHttpResponseCode(204);