CC-5807: Disk Space will be updated when file is not actually deleted

This commit is contained in:
drigato 2014-04-28 10:25:36 -04:00
parent 42806b1cbf
commit d081ff10b2
1 changed files with 3 additions and 3 deletions

View File

@ -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());