From 1b7d174509391d40d7c632ccafacdc3d1bdb28c0 Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 12:33:25 -0400 Subject: [PATCH 01/10] CC-4233: Smart Playlist: Cannot save the change of Fade in/out -fixed --- airtime_mvc/application/models/Block.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index 640389bbe..de611086d 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -643,7 +643,7 @@ EOT; return array("fadeIn" => $fadeIn, "fadeOut" => $fadeOut); } - public function setBlockfades($fadein, $fadeout) + public function setfades($fadein, $fadeout) { if (isset($fadein)) { Logging::log("Setting block fade in {$fadein}"); From 73ec580316bb59f78e8c28bc4639593681bd9d30 Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 13:02:48 -0400 Subject: [PATCH 02/10] Playlists: set cue/fade in/out were not saving when editing a playlist --- airtime_mvc/public/js/airtime/library/spl.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index e57ab7098..7c38352ef 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -337,6 +337,8 @@ var AIRTIME = (function(AIRTIME){ .append(json.html); setUpPlaylist(); + setCueEvents(); + setFadeEvents(); // functions in smart_playlistbuilder.js setupUI(); From 6b54440b7e38b11441a6e97c98d845abe3dd647b Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 14:35:24 -0400 Subject: [PATCH 03/10] CC-4238: Playlists: Fade in/out is in wrong format -fixed --- airtime_mvc/application/models/Block.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index de611086d..1a3bcfe75 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -215,6 +215,10 @@ EOT; $formatter = new LengthFormatter($offset_cliplength); $row['offset'] = $formatter->format(); + + $fades = $this->getFadeInfo($row['position']); + $row['fadein'] = $fades[0]; + $row['fadeout'] = $fades[1]; } return $rows; From 5e6a94edb9948027b898573925205a971fa271dc Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 14:37:10 -0400 Subject: [PATCH 04/10] CC-4238: Playlists: Fade in/out is in wrong format -fixed --- airtime_mvc/application/models/Playlist.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index 44ec4d5da..a08622e4e 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -235,6 +235,10 @@ SQL; $formatter = new LengthFormatter($offset_cliplength); $row['offset'] = $formatter->format(); + + $fades = $this->getFadeInfo($row['position']); + $row['fadein'] = $fades[0]; + $row['fadeout'] = $fades[1]; } return $rows; From ae0d5d85983819d20c8f14f386bfbb761bc9c826 Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 14:45:51 -0400 Subject: [PATCH 05/10] CC-4238: Playlists: Fade in/out is in wrong format -added comment --- airtime_mvc/application/models/Block.php | 1 + airtime_mvc/application/models/Playlist.php | 1 + 2 files changed, 2 insertions(+) diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index 1a3bcfe75..c6ff0ae0c 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -216,6 +216,7 @@ EOT; $formatter = new LengthFormatter($offset_cliplength); $row['offset'] = $formatter->format(); + //format the fades in format 00(.000000) $fades = $this->getFadeInfo($row['position']); $row['fadein'] = $fades[0]; $row['fadeout'] = $fades[1]; diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index a08622e4e..19023fc8d 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -236,6 +236,7 @@ SQL; $formatter = new LengthFormatter($offset_cliplength); $row['offset'] = $formatter->format(); + //format the fades in format 00(.000000) $fades = $this->getFadeInfo($row['position']); $row['fadein'] = $fades[0]; $row['fadeout'] = $fades[1]; From 0d21d9a9afd891b95b8efd57f64306f248864609 Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 15:40:36 -0400 Subject: [PATCH 06/10] Smart Playlists: code cleanup --- .../controllers/PlaylistController.php | 2 +- airtime_mvc/application/models/Block.php | 21 +++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/airtime_mvc/application/controllers/PlaylistController.php b/airtime_mvc/application/controllers/PlaylistController.php index 3956ee50d..1f213fea6 100644 --- a/airtime_mvc/application/controllers/PlaylistController.php +++ b/airtime_mvc/application/controllers/PlaylistController.php @@ -534,7 +534,7 @@ class PlaylistController extends Zend_Controller_Action $form->startForm($params['obj_id']); $bl = new Application_Model_Block($params['obj_id']); if ($form->isValid($params)) { - $result = $bl->saveSmartBlockCriteria($params['data']); + $bl->saveSmartBlockCriteria($params['data']); $result['html'] = $this->createFullResponse($bl, true); $result['result'] = 0; } else { diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index c6ff0ae0c..fbd429d1e 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -947,7 +947,6 @@ EOT; $this->storeCriteriaIntoDb($data); //get number of files that meet the criteria $files = $this->getListofFilesMeetCriteria(); - //$output['poolCount'] = $files["count"]; // if the block is dynamic, put null to the length // as it cannot be calculated if ($blockType == 'dynamic') { @@ -963,10 +962,8 @@ EOT; } $this->setLength($length); } - //$output['blockLength'] = $this->getFormattedLength(); $this->updateBlockLengthInAllPlaylist(); - return $output; } public function hasItemLimit() @@ -1018,17 +1015,13 @@ EOT; */ public function generateSmartBlock($p_criteria, $returnList=false) { - $result = $this->saveSmartBlockCriteria($p_criteria); - /*if ($result['result'] != 0) { - return $result; - } else {*/ - $insertList = $this->getListOfFilesUnderLimit(); - $this->deleteAllFilesFromBlock(); - $this->addAudioClips(array_keys($insertList)); - // update length in playlist contents. - $this->updateBlockLengthInAllPlaylist(); - return array("result"=>0); - //} + $this->saveSmartBlockCriteria($p_criteria); + $insertList = $this->getListOfFilesUnderLimit(); + $this->deleteAllFilesFromBlock(); + $this->addAudioClips(array_keys($insertList)); + // update length in playlist contents. + $this->updateBlockLengthInAllPlaylist(); + return array("result"=>0); } public function updateBlockLengthInAllPlaylist() From 45f08e41d19a82f50abc6eb756b15354a0e2ff5c Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 15:47:31 -0400 Subject: [PATCH 07/10] Smart playlists: fixed shuffle button activation clause --- airtime_mvc/public/js/airtime/playlist/smart_playlistbuilder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/playlist/smart_playlistbuilder.js b/airtime_mvc/public/js/airtime/playlist/smart_playlistbuilder.js index 064dcae5d..dc667f90c 100644 --- a/airtime_mvc/public/js/airtime/playlist/smart_playlistbuilder.js +++ b/airtime_mvc/public/js/airtime/playlist/smart_playlistbuilder.js @@ -335,7 +335,7 @@ function setupUI() { var plContents = $('#spl_sortable').children(); var shuffleButton = $('button[id="shuffle_button"]'); - if (plContents.length > 1) { + if (plContents.text() !== 'Empty playlist') { if (shuffleButton.hasClass('ui-state-disabled')) { shuffleButton.removeClass('ui-state-disabled'); } From b17cd2b3c9d112ae9cbd02bad40595416708b1c9 Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 15:58:03 -0400 Subject: [PATCH 08/10] CC-4178: Smart Playlist: Cannot update the block's title -fixed --- .../controllers/PlaylistController.php | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/airtime_mvc/application/controllers/PlaylistController.php b/airtime_mvc/application/controllers/PlaylistController.php index 1f213fea6..38db5dda8 100644 --- a/airtime_mvc/application/controllers/PlaylistController.php +++ b/airtime_mvc/application/controllers/PlaylistController.php @@ -488,7 +488,7 @@ class PlaylistController extends Zend_Controller_Action $obj = $this->getPlaylist($type); $obj->setName($name); $obj->setDescription($description); - $this->view->description = $obj->getDescription(); + $this->view->description = $description(); $this->view->playlistName = $name; $this->view->modified = $obj->getLastModified("U"); } catch (PlaylistOutDatedException $e) { @@ -499,27 +499,6 @@ class PlaylistController extends Zend_Controller_Action $this->playlistUnknownError($e); } } - - /* - public function setPlaylistDescriptionAction() - { - $description = $this->_getParam('description', ""); - $type = $this->_getParam('type'); - - try { - $obj = $this->getPlaylist($type); - $obj->setDescription($description); - $this->view->description = $obj->getDescription(); - $this->view->modified = $obj->getLastModified("U"); - } catch (PlaylistOutDatedException $e) { - $this->playlistOutdated($e); - } catch (PlaylistNotFoundException $e) { - $this->playlistNotFound($type); - } catch (Exception $e) { - $this->playlistUnknownError($e); - } - } - */ public function saveAction() { From 9930ffae3571010f1f29c38f3c0844c17ff79a4f Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 16:00:59 -0400 Subject: [PATCH 09/10] CC-4178: Smart Playlist: Cannot update the block's title -fixed --- airtime_mvc/application/controllers/PlaylistController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airtime_mvc/application/controllers/PlaylistController.php b/airtime_mvc/application/controllers/PlaylistController.php index 38db5dda8..94e90744d 100644 --- a/airtime_mvc/application/controllers/PlaylistController.php +++ b/airtime_mvc/application/controllers/PlaylistController.php @@ -488,7 +488,7 @@ class PlaylistController extends Zend_Controller_Action $obj = $this->getPlaylist($type); $obj->setName($name); $obj->setDescription($description); - $this->view->description = $description(); + $this->view->description = $description; $this->view->playlistName = $name; $this->view->modified = $obj->getLastModified("U"); } catch (PlaylistOutDatedException $e) { From 6b841a0fc448098940f83dac14d5a8c8f5e1f358 Mon Sep 17 00:00:00 2001 From: denise <denise@denise-DX4860.(none)> Date: Thu, 16 Aug 2012 17:11:48 -0400 Subject: [PATCH 10/10] CC-4239: Playlist: need to improve error msg "Something went wrong" -fixed --- airtime_mvc/public/js/airtime/library/spl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js index 7c38352ef..fc6bc7210 100644 --- a/airtime_mvc/public/js/airtime/library/spl.js +++ b/airtime_mvc/public/js/airtime/library/spl.js @@ -17,7 +17,8 @@ var AIRTIME = (function(AIRTIME){ width; function isTimeValid(time) { - var regExpr = new RegExp("^\\d{2}[:]\\d{2}[:]\\d{2}([.]\\d{1,6})?$"); + //var regExpr = new RegExp("^\\d{2}[:]\\d{2}[:]\\d{2}([.]\\d{1,6})?$"); + var regExpr = new RegExp("^\\d{2}[:]([0-5]){1}([0-9]){1}[:]([0-5]){1}([0-9]){1}([.]\\d{1,6})?$"); return regExpr.test(time); }