From d081ff10b2995fb8a8b1b92ae43c7e76b1a0fa9f Mon Sep 17 00:00:00 2001 From: drigato Date: Mon, 28 Apr 2014 10:25:36 -0400 Subject: [PATCH] CC-5807: Disk Space will be updated when file is not actually deleted --- airtime_mvc/application/models/StoredFile.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 87cbe0704..8e249e150 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -372,9 +372,6 @@ SQL; { $filepath = $this->getFilePath(); - //Update the user's disk usage - Application_Model_Preference::updateDiskUsage(-1 * abs(filesize($filepath))); - // Check if the file is scheduled to be played in the future if (Application_Model_Schedule::IsFileScheduledInTheFuture($this->getId())) { throw new DeleteScheduledFileException(); @@ -394,6 +391,9 @@ SQL; if (file_exists($filepath) && $type == "stor") { try { + //Update the user's disk usage + Application_Model_Preference::updateDiskUsage(-1 * abs(filesize($filepath))); + unlink($filepath); } catch (Exception $e) { Logging::error($e->getMessage());