From 27075ad369bc1b3ce9ff27469a8d0fff99e17000 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Fri, 3 Jun 2011 18:12:10 -0400 Subject: [PATCH 01/11] CC-2356 Default genre when uploading to Soundcloud doesn't work function call changed incorrectly. --- airtime_mvc/application/models/Soundcloud.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/Soundcloud.php b/airtime_mvc/application/models/Soundcloud.php index bc9f416d1..388907dbc 100644 --- a/airtime_mvc/application/models/Soundcloud.php +++ b/airtime_mvc/application/models/Soundcloud.php @@ -28,7 +28,7 @@ class ATSoundcloud { 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()) { @@ -47,7 +47,7 @@ class ATSoundcloud { 'track[tag_list]' => $tags, 'track[description]' => $description, 'track[downloadable]' => true, - + ); if(isset($release)) { @@ -61,12 +61,12 @@ class ATSoundcloud { $track_data['track[release_month]'] = $release[1]; $track_data['track[release_day]'] = $release[2]; } - + if (isset($genre) && $genre != "") { $track_data['track[genre]'] = $genre; } else { - $default_genre = Application_Model_Preference::GetSoundCloudTrackType(); + $default_genre = Application_Model_Preference::GetSoundCloudGenre(); if ($genre != "") { $track_data['track[genre]'] = $default_genre; } @@ -88,7 +88,7 @@ class ATSoundcloud { ); return $response["id"]; - } + } } } From 1f045c8c7be32dbb3c9dd50d419ed9e073876fbd Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Sat, 4 Jun 2011 15:40:58 +0200 Subject: [PATCH 02/11] CC-2356 Default genre when uploading to Soundcloud doesn't work somehow variable names must have changed. --- airtime_mvc/application/models/Soundcloud.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Soundcloud.php b/airtime_mvc/application/models/Soundcloud.php index 388907dbc..5e17049b6 100644 --- a/airtime_mvc/application/models/Soundcloud.php +++ b/airtime_mvc/application/models/Soundcloud.php @@ -67,7 +67,7 @@ class ATSoundcloud { } else { $default_genre = Application_Model_Preference::GetSoundCloudGenre(); - if ($genre != "") { + if ($default_genre != "") { $track_data['track[genre]'] = $default_genre; } } From d5918585283890dafb6b0d7ca2a7b4276db3529e Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 6 Jun 2011 12:01:37 -0400 Subject: [PATCH 03/11] cc-2362: upload to soundcloud with the wrong name after show rename. -changed so that recorded shows are not deleted by default -changed static method to non-static. --- airtime_mvc/application/models/Shows.php | 69 ++++++++++++------------ 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index 2340a6a1d..4c9d522d9 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -556,52 +556,49 @@ class Show { return CcShowInstancesQuery::create()->findPk($row); } - public static function deletePossiblyInvalidInstances($p_data, $p_show, $p_endDate, $isRecorded, $repeatType) + public function deletePossiblyInvalidInstances($p_data, $p_endDate, $isRecorded, $repeatType) { - if (($p_data['add_show_repeats'] != $p_show->isRepeating()) || ($isRecorded && !$p_data['add_show_repeats'])){ - //repeat option was toggled. - $p_show->deleteAllInstances(); - } - if($isRecorded && $p_data['add_show_repeats']) { - $p_show->removeAllInstancesFromDate(); + if ($p_data['add_show_repeats'] != $this->isRepeating()){ + //repeat option was toggled + $this->deleteAllInstances(); } - if ($p_data['add_show_duration'] != $p_show->getDuration()){ + if ($p_data['add_show_duration'] != $this->getDuration()){ //duration has changed - $p_show->updateDurationTime($p_data); + $this->updateDurationTime($p_data); } if ($p_data['add_show_repeats']){ - if (($repeatType == 1 || $repeatType == 2) && - $p_data['add_show_start_date'] != $p_show->getStartDate()){ - + if (($repeatType == 1 || $repeatType == 2) && + $p_data['add_show_start_date'] != $this->getStartDate()){ + //start date has changed when repeat type is bi-weekly or monthly. //This screws up the repeating positions of show instances, so lets - //just delete them for now. - - $p_show->deleteAllInstances(); + //just delete them for now. (CC-2351) + + $this->deleteAllInstances(); } - - if ($p_data['add_show_start_date'] != $p_show->getStartDate() - || $p_data['add_show_start_time'] != $p_show->getStartTime()){ + + if ($p_data['add_show_start_date'] != $this->getStartDate() + || $p_data['add_show_start_time'] != $this->getStartTime()){ //start date/time has changed $newDate = strtotime($p_data['add_show_start_date']); - $oldDate = strtotime($p_show->getStartDate()); + $oldDate = strtotime($this->getStartDate()); if ($newDate > $oldDate){ - $p_show->removeAllInstancesBeforeDate($p_data['add_show_start_date']); + $this->removeAllInstancesBeforeDate($p_data['add_show_start_date']); } - $p_show->updateStartDateTime($p_data, $p_endDate); + $this->updateStartDateTime($p_data, $p_endDate); } - - if ($repeatType != $p_show->getRepeatType()){ + + if ($repeatType != $this->getRepeatType()){ //repeat type changed. - $p_show->deleteAllInstances(); + $this->deleteAllInstances(); } else { //repeat type is the same, check if the days of the week are the same $repeatingDaysChanged = false; - $showDaysArray = $p_show->getShowDays(); + $showDaysArray = $this->getShowDays(); if (count($p_data['add_show_day_check']) == count($showDaysArray)){ //same number of days checked, lets see if they are the same numbers $intersect = array_intersect($p_data['add_show_day_check'], $showDaysArray); @@ -617,28 +614,28 @@ class Show { $daysRemoved = array_diff($showDaysArray, $p_data['add_show_day_check']); if (count($daysRemoved) > 0){ - $p_show->removeUncheckedDaysInstances($daysRemoved); + $this->removeUncheckedDaysInstances($daysRemoved); } } } //Check if end date for the repeat option has changed. If so, need to take care //of deleting possible invalid Show Instances. - if ((strlen($p_show->getRepeatingEndDate()) == 0) == $p_data['add_show_no_end']){ + if ((strlen($this->getRepeatingEndDate()) == 0) == $p_data['add_show_no_end']){ //show "Never Ends" option was toggled. if ($p_data['add_show_no_end']){ } else { - $p_show->removeAllInstancesFromDate($p_endDate); + $this->removeAllInstancesFromDate($p_endDate); } } - if ($p_show->getRepeatingEndDate() != $p_data['add_show_end_date']){ + if ($this->getRepeatingEndDate() != $p_data['add_show_end_date']){ //end date was changed. $newDate = strtotime($p_data['add_show_end_date']); - $oldDate = strtotime($p_show->getRepeatingEndDate()); + $oldDate = strtotime($this->getRepeatingEndDate()); if ($newDate < $oldDate){ - $p_show->removeAllInstancesFromDate($p_endDate); + $this->removeAllInstancesFromDate($p_endDate); } } } @@ -704,7 +701,7 @@ class Show { $isRecorded = ($data['add_show_record']) ? 1 : 0; if ($data['add_show_id'] != -1){ - Show::deletePossiblyInvalidInstances($data, $show, $endDate, $isRecorded, $repeatType); + $show->deletePossiblyInvalidInstances($data, $endDate, $isRecorded, $repeatType); } //check if we are adding or updating a show, and if updating @@ -908,7 +905,7 @@ class Show { $ccShowInstance = new CcShowInstances(); $newInstance = true; } - + if ($newInstance || $ccShowInstance->getDbStarts() > $currentTimestamp){ $ccShowInstance->setDbShowId($show_id); $ccShowInstance->setDbStarts($start); @@ -986,10 +983,10 @@ class Show { $ccShowInstance = new CcShowInstances(); $newInstance = true; } - + /* When editing the start/end time of a repeating show, we don't want to - * change shows that started in the past. So check the start time. - */ + * change shows that started in the past. So check the start time. + */ if ($newInstance || $ccShowInstance->getDbStarts() > $currentTimestamp){ $ccShowInstance->setDbShowId($show_id); $ccShowInstance->setDbStarts($start); From 1de4777de325302b49ebad3b6ab0b1cf577ea3e9 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 6 Jun 2011 12:20:44 -0400 Subject: [PATCH 04/11] cc-2362: upload to soundcloud with the wrong name after show rename. -make sure to remove all rebroadcasts of recorded shows when editing. --- airtime_mvc/application/models/Shows.php | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index 4c9d522d9..2a7869073 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -312,6 +312,26 @@ class Show { $CC_DBC->query($sql); } + + /** + * Deletes all future rebroadcast instances of the current + * show object from the show_instances table. + * + */ + public function deleteAllRebroadcasts(){ + global $CC_DBC; + + $date = new DateHelper; + $timestamp = $date->getTimestamp(); + + $showId = $this->getId(); + $sql = "DELETE FROM cc_show_instances" + ." WHERE starts > TIMESTAMP '$timestamp'" + ." AND show_id = $showId" + ." AND rebroadcast = 1"; + + $CC_DBC->query($sql); + } /** * Deletes all show instances of current show after a @@ -567,6 +587,14 @@ class Show { //duration has changed $this->updateDurationTime($p_data); } + + if ($isRecorded){ + //delete all rebroadcasts. They will simply be recreated later + //in the execution of this PHP script. This simplifies having to + //reason about whether we should keep individual rebroadcasts or + //delete them or move them around etc. + $this->deleteAllRebroadcasts(); + } if ($p_data['add_show_repeats']){ if (($repeatType == 1 || $repeatType == 2) && From 02e259c0eafa11ec5ee51170f934df50c042c1b5 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Mon, 6 Jun 2011 18:56:32 +0200 Subject: [PATCH 05/11] CC-2365 Shows from the past can be dragged into the future adding a backend check if the show has started in the past. --- airtime_mvc/application/models/Shows.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index 2a7869073..449152caa 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -312,9 +312,9 @@ class Show { $CC_DBC->query($sql); } - + /** - * Deletes all future rebroadcast instances of the current + * Deletes all future rebroadcast instances of the current * show object from the show_instances table. * */ @@ -587,11 +587,11 @@ class Show { //duration has changed $this->updateDurationTime($p_data); } - + if ($isRecorded){ //delete all rebroadcasts. They will simply be recreated later - //in the execution of this PHP script. This simplifies having to - //reason about whether we should keep individual rebroadcasts or + //in the execution of this PHP script. This simplifies having to + //reason about whether we should keep individual rebroadcasts or //delete them or move them around etc. $this->deleteAllRebroadcasts(); } @@ -1172,7 +1172,7 @@ class Show { $options["percent"] = $show_instance->getPercentScheduled(); } - if ($editable && strtotime($today_timestamp) < strtotime($show["starts"])) { + if ($editable && (strtotime($today_timestamp) < strtotime($show["starts"]))) { $options["editable"] = true; $events[] = Show::makeFullCalendarEvent($show, $options); } @@ -1382,16 +1382,20 @@ class ShowInstance { $mins = abs($deltaMin%60); + $today_timestamp = date("Y-m-d H:i:s"); $starts = $this->getShowStart(); $ends = $this->getShowEnd(); + if(strtotime($today_timestamp) > strtotime($starts)) { + return "can't move a past show"; + } + $sql = "SELECT timestamp '{$starts}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'"; $new_starts = $CC_DBC->GetOne($sql); $sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'"; $new_ends = $CC_DBC->GetOne($sql); - $today_timestamp = date("Y-m-d H:i:s"); if(strtotime($today_timestamp) > strtotime($new_starts)) { return "can't move show into past"; } @@ -1430,9 +1434,14 @@ class ShowInstance { $mins = abs($deltaMin%60); + $today_timestamp = date("Y-m-d H:i:s"); $starts = $this->getShowStart(); $ends = $this->getShowEnd(); + if(strtotime($today_timestamp) > strtotime($starts)) { + return "can't resize a past show"; + } + $sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'"; $new_ends = $CC_DBC->GetOne($sql); From 0f942d149de7b155cc2a346e48e6a58fe43251da Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Mon, 6 Jun 2011 20:05:35 +0200 Subject: [PATCH 06/11] CC-2326 Edit a show (End Date problems) not clearing options array. --- airtime_mvc/application/models/Shows.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Shows.php b/airtime_mvc/application/models/Shows.php index 07a48f3f5..6bcffd096 100644 --- a/airtime_mvc/application/models/Shows.php +++ b/airtime_mvc/application/models/Shows.php @@ -1070,7 +1070,6 @@ class Show { public static function getFullCalendarEvents($start, $end, $editable=false) { $events = array(); - $options = array(); $start_range = new DateTime($start); $end_range = new DateTime($end); @@ -1081,6 +1080,8 @@ class Show { $today_timestamp = date("Y-m-d H:i:s"); foreach ($shows as $show) { + $options = array(); + //only bother calculating percent for week or day view. if(intval($days) <= 7) { $show_instance = new ShowInstance($show["instance_id"]); From 4247f8c7a7710eadd4fd3dbea994f64f3ba5488d Mon Sep 17 00:00:00 2001 From: james Date: Mon, 6 Jun 2011 10:18:03 -0400 Subject: [PATCH 07/11] CC-2362:Recorded show wrong file name - not finished yet. Temp commit --- .../application/controllers/ApiController.php | 79 +++++++++++-------- airtime_mvc/application/models/StoredFile.php | 30 +++---- python_apps/show-recorder/recorder.py | 8 +- 3 files changed, 64 insertions(+), 53 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index dce293b0d..f298a0052 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -294,51 +294,68 @@ class ApiController extends Zend_Controller_Action exit; } + $logger = Logging::getLogger(); + + $showCanceled = false; + $show_instance = $this->_getParam('show_instance'); + + $logger->info("Show instance:" . $show_instance); + $upload_dir = ini_get("upload_tmp_dir"); $file = StoredFile::uploadFile($upload_dir); - - $show_instance = $this->_getParam('show_instance'); - + + $show_name = ""; try { + $logger->info("before declare"); $show_inst = new ShowInstance($show_instance); - +$logger->info("after"); $show_inst->setRecordedFile($file->getId()); $show_name = $show_inst->getName(); $show_genre = $show_inst->getGenre(); $show_start_time = $show_inst->getShowStart(); - if(Application_Model_Preference::GetDoSoundCloudUpload()) - { - for($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) { - - $show = new Show($show_inst->getShowId()); - $description = $show->getDescription(); - $hosts = $show->getHosts(); - - $tags = array_merge($hosts, array($show_name)); - - try { - $soundcloud = new ATSoundcloud(); - $soundcloud_id = $soundcloud->uploadTrack($file->getRealFilePath(), $file->getName(), $description, $tags, $show_start_time, $show_genre); - $show_inst->setSoundCloudFileId($soundcloud_id); - break; - } - catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) { - $code = $e->getHttpCode(); - if(!in_array($code, array(0, 100))) { - break; - } - } - - sleep($CC_CONFIG['soundcloud-connection-wait']); - } - } - } catch (Exception $e){ + } catch (Exception $e){ //we've reached here probably because the show was //cancelled, and therefore the show instance does not //exist anymore (ShowInstance constructor threw this error). //We've done all we can do (upload the file and put it in //the library), now lets just return. + $showCanceled = true; + } + + $logger->info("Show name:" . $show_name); + + $tmpTitle = !(empty($show_name))?$show_name."-":""; + $tmpTitle .= $file->getName(); + $logger->info("Tmp title".$tmpTitle); + + $file->setMetadataValue(UI_MDATA_KEY_TITLE, $tmpTitle); + + if (!$showCanceled && Application_Model_Preference::GetDoSoundCloudUpload()) + { + for ($i=0; $i<$CC_CONFIG['soundcloud-connection-retries']; $i++) { + + $show = new Show($show_inst->getShowId()); + $description = $show->getDescription(); + $hosts = $show->getHosts(); + + $tags = array_merge($hosts, array($show_name)); + + try { + $soundcloud = new ATSoundcloud(); + $soundcloud_id = $soundcloud->uploadTrack($file->getRealFilePath(), $file->getName(), $description, $tags, $show_start_time, $show_genre); + $show_inst->setSoundCloudFileId($soundcloud_id); + break; + } + catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) { + $code = $e->getHttpCode(); + if(!in_array($code, array(0, 100))) { + break; + } + } + + sleep($CC_CONFIG['soundcloud-connection-wait']); + } } $this->view->id = $file->getId(); diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 370b27cdb..ff0d6f447 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -1693,8 +1693,8 @@ class StoredFile { return array("sEcho" => intval($data["sEcho"]), "iTotalDisplayRecords" => $totalDisplayRows, "iTotalRecords" => $totalRows, "aaData" => $results); } - public static function uploadFile($targetDir) { - + public static function uploadFile($p_targetDir) + { // HTTP headers for no cache etc header('Content-type: text/plain; charset=UTF-8'); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); @@ -1704,7 +1704,7 @@ class StoredFile { header("Pragma: no-cache"); // Settings - //$targetDir = ini_get("upload_tmp_dir"); //. DIRECTORY_SEPARATOR . "plupload"; + //$p_targetDir = ini_get("upload_tmp_dir"); //. DIRECTORY_SEPARATOR . "plupload"; $cleanupTargetDir = false; // Remove old files $maxFileAge = 60 * 60; // Temp file age in seconds @@ -1721,13 +1721,13 @@ class StoredFile { //$fileName = preg_replace('/[^\w\._]+/', '', $fileName); // Create target dir - if (!file_exists($targetDir)) - @mkdir($targetDir); + if (!file_exists($p_targetDir)) + @mkdir($p_targetDir); // Remove old temp files - if (is_dir($targetDir) && ($dir = opendir($targetDir))) { + if (is_dir($p_targetDir) && ($dir = opendir($p_targetDir))) { while (($file = readdir($dir)) !== false) { - $filePath = $targetDir . DIRECTORY_SEPARATOR . $file; + $filePath = $p_targetDir . DIRECTORY_SEPARATOR . $file; // Remove temp files if they are older than the max age if (preg_match('/\.tmp$/', $file) && (filemtime($filePath) < time() - $maxFileAge)) @@ -1748,7 +1748,7 @@ class StoredFile { if (strpos($contentType, "multipart") !== false) { if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) { // Open temp file - $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab"); + $out = fopen($p_targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab"); if ($out) { // Read binary input stream and append it to temp file $in = fopen($_FILES['file']['tmp_name'], "rb"); @@ -1767,7 +1767,7 @@ class StoredFile { die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}'); } else { // Open temp file - $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab"); + $out = fopen($p_targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab"); if ($out) { // Read binary input stream and append it to temp file $in = fopen("php://input", "rb"); @@ -1783,7 +1783,7 @@ class StoredFile { die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}'); } - $audio_file = $targetDir . DIRECTORY_SEPARATOR . $fileName; + $audio_file = $p_targetDir . DIRECTORY_SEPARATOR . $fileName; $md5 = md5_file($audio_file); $duplicate = StoredFile::RecallByMd5($md5); @@ -1812,18 +1812,14 @@ class StoredFile { die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": ' + $metadata->getMessage() + '}}'); } - // #2196 no id tag -> use the original filename - if (basename($audio_file) == $metadata[UI_MDATA_KEY_TITLE]) { + // no id3 title tag -> use the original filename for title + if (empty($metadata[UI_MDATA_KEY_TITLE])) { $metadata[UI_MDATA_KEY_TITLE] = basename($audio_file); $metadata[UI_MDATA_KEY_FILENAME] = basename($audio_file); } - // setMetadataBatch doesnt like these values - unset($metadata['audio']); - unset($metadata['playtime_seconds']); - $values = array( - "filename" => basename($audio_file), + "filename" => basename($audio_file), "filepath" => $audio_file, "filetype" => "audioclip", "mime" => $metadata[UI_MDATA_KEY_FORMAT], diff --git a/python_apps/show-recorder/recorder.py b/python_apps/show-recorder/recorder.py index 367779a5a..8986275be 100644 --- a/python_apps/show-recorder/recorder.py +++ b/python_apps/show-recorder/recorder.py @@ -47,11 +47,10 @@ def getDateTimeObj(time): class ShowRecorder(Thread): - def __init__ (self, show_instance, filelength, show_name, start_time, filetype): + def __init__ (self, show_instance, filelength, start_time, filetype): Thread.__init__(self) self.api_client = api_client.api_client_factory(config) self.filelength = filelength - self.show_name = show_name self.start_time = start_time self.filetype = filetype self.show_instance = show_instance @@ -60,7 +59,7 @@ class ShowRecorder(Thread): def record_show(self): length = str(self.filelength)+".0" - filename = self.show_name+" "+self.start_time + filename = self.start_time filename = filename.replace(" ", "-") filepath = "%s%s.%s" % (config["base_recorded_files"], filename, self.filetype) @@ -154,9 +153,8 @@ class Record(): show_length = self.shows_to_record[start_time][0] show_instance = self.shows_to_record[start_time][1] - show_name = self.shows_to_record[start_time][2] - self.sr = ShowRecorder(show_instance, show_length.seconds, show_name, start_time, filetype="mp3") + self.sr = ShowRecorder(show_instance, show_length.seconds, start_time, filetype="mp3") self.sr.start() #remove show from shows to record. From ff031cde76795d319b898c7b639566918381e4be Mon Sep 17 00:00:00 2001 From: james Date: Mon, 6 Jun 2011 14:25:46 -0400 Subject: [PATCH 08/11] CC-2362:Recorded show wrong file name - removed logging --- airtime_mvc/application/controllers/ApiController.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index f298a0052..fbbb3e78a 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -293,22 +293,17 @@ class ApiController extends Zend_Controller_Action print 'You are not allowed to access this resource.'; exit; } - - $logger = Logging::getLogger(); $showCanceled = false; $show_instance = $this->_getParam('show_instance'); - - $logger->info("Show instance:" . $show_instance); $upload_dir = ini_get("upload_tmp_dir"); $file = StoredFile::uploadFile($upload_dir); $show_name = ""; try { - $logger->info("before declare"); $show_inst = new ShowInstance($show_instance); -$logger->info("after"); + $show_inst->setRecordedFile($file->getId()); $show_name = $show_inst->getName(); $show_genre = $show_inst->getGenre(); @@ -323,11 +318,8 @@ $logger->info("after"); $showCanceled = true; } - $logger->info("Show name:" . $show_name); - $tmpTitle = !(empty($show_name))?$show_name."-":""; $tmpTitle .= $file->getName(); - $logger->info("Tmp title".$tmpTitle); $file->setMetadataValue(UI_MDATA_KEY_TITLE, $tmpTitle); From c921348f36ee38bfa645d0f23afecc415c0eca91 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 6 Jun 2011 15:15:47 -0400 Subject: [PATCH 09/11] cc-2364: past non-recorded shows have "upload to soundcloud" context menu option -fixed --- airtime_mvc/application/controllers/ScheduleController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index 3ef84548e..6377f13a2 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -203,6 +203,7 @@ class ScheduleController extends Zend_Controller_Action if (strtotime($show->getShowEnd()) <= strtotime($today_timestamp) && is_null($show->getSoundCloudFileId()) + && $show->isRecorded() && Application_Model_Preference::GetDoSoundCloudUpload()) { $menu[] = array('action' => array('type' => 'fn', 'callback' => "window['uploadToSoundCloud']($id)"), From 93562d2319d4d6284ae6eadc4588c90c0f52dceb Mon Sep 17 00:00:00 2001 From: james Date: Mon, 6 Jun 2011 16:46:32 -0400 Subject: [PATCH 10/11] CC-2362:Recorded show wrong file name Fixed bug on sending wrong file name to soundcloud --- airtime_mvc/application/controllers/ApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index fbbb3e78a..1b9a03b06 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -335,7 +335,7 @@ class ApiController extends Zend_Controller_Action try { $soundcloud = new ATSoundcloud(); - $soundcloud_id = $soundcloud->uploadTrack($file->getRealFilePath(), $file->getName(), $description, $tags, $show_start_time, $show_genre); + $soundcloud_id = $soundcloud->uploadTrack($file->getRealFilePath(), $tmpTitle, $description, $tags, $show_start_time, $show_genre); $show_inst->setSoundCloudFileId($soundcloud_id); break; } From 97f297a6eb739e7c4dc32ac7228c4ff342821701 Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 6 Jun 2011 17:13:08 -0400 Subject: [PATCH 11/11] updated changed log for 1.8.2 RC3 --- Changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog b/Changelog index 0ff1c3f4b..5e2a2e38c 100644 --- a/Changelog +++ b/Changelog @@ -20,6 +20,9 @@ Highlights: - Fixed various editing show problems - Fixed airtime-pypo-stop/start causing playback problems - Fixed incorrect information being occasionally shown in the top panel + - Fixed problem with Record Check box occasionally being greyed-out when creating new show + - Fixed a problem with default genre not being applied to recorded shows + - Fixed a problem where shows repeating bi-weekly or monthly did not update properly when edited. 1.8.1 - May 2, 2011