From 92a5bf51a689955637e7a7718319c1a969b8bbe2 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 12:45:33 -0400 Subject: [PATCH] Added warning for uploading unknown file types --- airtime_mvc/application/controllers/LibraryController.php | 8 +++++--- airtime_mvc/application/models/Soundcloud.php | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php index e05747200..fa6a92e68 100644 --- a/airtime_mvc/application/controllers/LibraryController.php +++ b/airtime_mvc/application/controllers/LibraryController.php @@ -486,10 +486,12 @@ class LibraryController extends Zend_Controller_Action $this->view->error_code = $file->getSoundCloudErrorCode(); $this->view->error_msg = $file->getSoundCloudErrorMsg(); } elseif ($type == "file") { - $file = Application_Model_StoredFile::Recall($id); - $this->view->sc_id = $file->getSoundCloudId(); + $file = Application_Model_StoredFile::Recall($id); + $this->view->sc_id = $file->getSoundCloudId(); $this->view->error_code = $file->getSoundCloudErrorCode(); - $this->view->error_msg = $file->getSoundCloudErrorMsg(); + $this->view->error_msg = $file->getSoundCloudErrorMsg(); + } else { + Logging::warn("Trying to upload unknown type: $type with id: $id"); } } } diff --git a/airtime_mvc/application/models/Soundcloud.php b/airtime_mvc/application/models/Soundcloud.php index b6d8cedfc..7e2b74d57 100644 --- a/airtime_mvc/application/models/Soundcloud.php +++ b/airtime_mvc/application/models/Soundcloud.php @@ -23,7 +23,8 @@ class Application_Model_Soundcloud return $token; } - public function uploadTrack($filepath, $filename, $description, $tags=array(), $release=null, $genre=null) + public function uploadTrack($filepath, $filename, $description, + $tags=array(), $release=null, $genre=null) { if ($this->getToken()) { if (count($tags)) {