From 92a5bf51a689955637e7a7718319c1a969b8bbe2 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 12:45:33 -0400 Subject: [PATCH 1/5] 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)) { From fef949f6eabc52acb8d63bfbd221cf906dec4eb7 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 12:50:04 -0400 Subject: [PATCH 2/5] band aided some bug --- airtime_mvc/application/models/Preference.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 807d23b6d..33059cebd 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($ds['ColReorder'], $x) ) { + 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; + } + } ; } } From c7c74e18a7f4a2b01a5cf75d45b2988b85148150 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 14:17:22 -0400 Subject: [PATCH 3/5] removed carriege returns --- utils/soundcloud-uploader.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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'); From ed45011b40b00ae5496c7a4a8e38708a5c23de16 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 17 Sep 2012 14:21:13 -0400 Subject: [PATCH 4/5] needle <-> haystack --- airtime_mvc/application/models/Preference.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 33059cebd..c73426a2d 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1101,7 +1101,7 @@ class Application_Model_Preference } else { $ds = unserialize($v); return function ($x) use ($ds) { - if ( in_array($ds['ColReorder'], $x) ) { + if ( in_array($x, $ds['ColReorder'] ) ) { return $ds['ColReorder'][$x]; } else { Logging::warn("Index $x does not exist preferences"); From 8801ccecce904d0bd538d9f53617f9297c43a9ca Mon Sep 17 00:00:00 2001 From: denise Date: Mon, 17 Sep 2012 14:52:56 -0400 Subject: [PATCH 5/5] CC-4459: Now Playing -> Timeline: 'Filter by show' does not work -fixed --- airtime_mvc/application/models/Schedule.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index eb538f57f..16b90a647 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;