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/Preference.php b/airtime_mvc/application/models/Preference.php index 807d23b6d..c73426a2d 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1100,7 +1100,17 @@ class Application_Model_Preference return function ($x) { return $x; }; } else { $ds = unserialize($v); - return function ($x) use ($ds) { return $ds['ColReorder'][$x]; } ; + return function ($x) use ($ds) { + if ( in_array($x, $ds['ColReorder'] ) ) { + return $ds['ColReorder'][$x]; + } else { + Logging::warn("Index $x does not exist preferences"); + Logging::warn("Defaulting to identity and printing + preferences"); + Logging::warn($ds); + return $x; + } + } ; } } diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 4914302b6..5e92ca514 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -344,12 +344,12 @@ SELECT showt.name AS show_name, JOIN cc_show AS showt ON (showt.id = si.show_id) WHERE si.modified_instance = FALSE $showPredicate - AND (si.starts >= '{$p_start}' + AND ((si.starts >= '{$p_start}' AND si.starts < '{$p_end}') OR (si.ends > '{$p_start}' AND si.ends <= '{$p_end}') OR (si.starts <= '{$p_start}' - AND si.ends >= '{$p_end}') + AND si.ends >= '{$p_end}')) ORDER BY si_starts, sched_starts; SQL; 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)) { diff --git a/utils/soundcloud-uploader.php b/utils/soundcloud-uploader.php index e7b116785..ea6826aab 100644 --- a/utils/soundcloud-uploader.php +++ b/utils/soundcloud-uploader.php @@ -24,11 +24,11 @@ require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php'); $CC_CONFIG['phpDir'] = $values['general']['airtime_dir']; -// Ensure library/ is on include_path -set_include_path(implode(PATH_SEPARATOR, array( - get_include_path(), - realpath($CC_CONFIG['phpDir'] . '/library') -))); +// Ensure library/ is on include_path +set_include_path(implode(PATH_SEPARATOR, array( + get_include_path(), + realpath($CC_CONFIG['phpDir'] . '/library') +))); require_once($CC_CONFIG['phpDir'].'/application/models/StoredFile.php'); require_once($CC_CONFIG['phpDir'].'/application/models/Preference.php');