diff --git a/airtime_mvc/application/controllers/PlaylistController.php b/airtime_mvc/application/controllers/PlaylistController.php index ab42823e7..a52c7ea15 100644 --- a/airtime_mvc/application/controllers/PlaylistController.php +++ b/airtime_mvc/application/controllers/PlaylistController.php @@ -418,31 +418,31 @@ class PlaylistController extends Zend_Controller_Action } } - public function setCrossFadeAction() - { - $id = $this->_getParam('id'); - $fadeIn = $this->_getParam('fadeIn', 0); - $fadeOut = $this->_getParam('fadeOut', 0); + public function setCrossFadeAction() + { + $id = $this->_getParam('id'); + $fadeIn = $this->_getParam('fadeIn', 0); + $fadeOut = $this->_getParam('fadeOut', 0); $type = $this->_getParam('type'); - $offset = $this->_getParam('offset', 0); - - try { - $obj = $this->getPlaylist($type); - $response = $obj->changeFadeInfo($id, $fadeIn, $fadeOut); - - if (!isset($response["error"])) { - $this->createUpdateResponse($obj); - $this->view->response = $response; - } else { - $this->view->fade_error = $response["error"]; - } - } catch (PlaylistOutDatedException $e) { - $this->playlistOutdated($e); - } catch (PlaylistNotFoundException $e) { - $this->playlistNotFound($type); - } catch (Exception $e) { - $this->playlistUnknownError($e); - } + $offset = $this->_getParam('offset', 0); + + try { + $obj = $this->getPlaylist($type); + $response = $obj->changeFadeInfo($id, $fadeIn, $fadeOut); + + if (!isset($response["error"])) { + $this->createUpdateResponse($obj); + $this->view->response = $response; + } else { + $this->view->fade_error = $response["error"]; + } + } catch (PlaylistOutDatedException $e) { + $this->playlistOutdated($e); + } catch (PlaylistNotFoundException $e) { + $this->playlistNotFound($type); + } catch (Exception $e) { + $this->playlistUnknownError($e); + } } public function getPlaylistFadesAction() diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php index e5610ec4f..388af70fc 100644 --- a/airtime_mvc/application/models/Playlist.php +++ b/airtime_mvc/application/models/Playlist.php @@ -655,10 +655,10 @@ SQL; */ public function createCrossfade($id1, $id2, $fadeIn, $fadeOut, $offset) { - $this->con->beginTransaction(); - + $this->con->beginTransaction(); + try { - $this->changeFadeInfo($id1, null, $fadeOut); + $this->changeFadeInfo($id1, null, $fadeOut); $this->changeFadeInfo($id2, $fadeIn, null); $item = CcPlaylistcontentsQuery::create()->findPK($id2);