From 2827db8ba3c6153d7453aff20745ba76aa06e9a2 Mon Sep 17 00:00:00 2001 From: drigato Date: Thu, 13 Nov 2014 09:05:02 -0500 Subject: [PATCH] Fix bad merge --- .../rest/controllers/MediaController.php | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/airtime_mvc/application/modules/rest/controllers/MediaController.php b/airtime_mvc/application/modules/rest/controllers/MediaController.php index 5cfb682c3..ef28f207c 100644 --- a/airtime_mvc/application/modules/rest/controllers/MediaController.php +++ b/airtime_mvc/application/modules/rest/controllers/MediaController.php @@ -227,7 +227,7 @@ class Rest_MediaController extends Zend_Rest_Controller $file->setDbFilepath($requestData["filename"]); $fileSizeBytes = $requestData["filesize"]; - if ($fileSizeBytes === false) + if (!isset($fileSizeBytes) || $fileSizeBytes === false) { $file->setDbImportStatus(2)->save(); $this->fileNotFoundResponse(); @@ -237,30 +237,6 @@ class Rest_MediaController extends Zend_Rest_Controller $cloudFile->setResourceId($requestData["resource_id"]); $cloudFile->setCcFiles($file); $cloudFile->save(); - - //file is stored locally - //we should get rid of this since we're removing local file storage - } else if (isset($requestData["full_path"])) { - $fileSizeBytes = filesize($requestData["full_path"]); - if ($fileSizeBytes === false) - { - $file->setDbImportStatus(2)->save(); - $this->fileNotFoundResponse(); - return; - } - - $fullPath = $requestData["full_path"]; - $storDir = Application_Model_MusicDir::getStorDir()->getDirectory(); - $pos = strpos($fullPath, $storDir); - - if ($pos !== FALSE) - { - assert($pos == 0); //Path must start with the stor directory path - - $filePathRelativeToStor = substr($fullPath, strlen($storDir)); - $file->setDbFilepath($filePathRelativeToStor); - $file->setDbDirectory(1); //1 corresponds to the default stor/imported directory. - } } Application_Model_Preference::updateDiskUsage($fileSizeBytes);