Merge branch '2.4.x' of dev.sourcefabric.org:airtime into 2.4.x

Conflicts:
	python_apps/pypo/liquidsoap_scripts/ls_script.liq
This commit is contained in:
Martin Konecny 2013-05-22 18:08:14 -04:00
commit 5c11f5fc72
4 changed files with 39 additions and 2 deletions

View File

@ -383,6 +383,7 @@ class PlaylistController extends Zend_Controller_Action
$this->createUpdateResponse($obj); $this->createUpdateResponse($obj);
} else { } else {
$this->view->cue_error = $response["error"]; $this->view->cue_error = $response["error"];
$this->view->code = $response["type"];
} }
} catch (PlaylistOutDatedException $e) { } catch (PlaylistOutDatedException $e) {
$this->playlistOutdated($e); $this->playlistOutdated($e);

View File

@ -10,6 +10,10 @@ require_once 'formatters/LengthFormatter.php';
*/ */
class Application_Model_Playlist implements Application_Model_LibraryEditable class Application_Model_Playlist implements Application_Model_LibraryEditable
{ {
const CUE_ALL_ERROR = 0;
const CUE_IN_ERROR = 1;
const CUE_OUT_ERROR = 2;
/** /**
* propel connection object. * propel connection object.
*/ */
@ -792,6 +796,7 @@ SQL;
try { try {
if (is_null($cueIn) && is_null($cueOut)) { if (is_null($cueIn) && is_null($cueOut)) {
$errArray["error"] = _("Cue in and cue out are null."); $errArray["error"] = _("Cue in and cue out are null.");
$errArray["type"] = self::CUE_ALL_ERROR;
return $errArray; return $errArray;
} }
@ -822,6 +827,7 @@ SQL;
$sql = "SELECT :cueIn::INTERVAL > :cueOut::INTERVAL"; $sql = "SELECT :cueIn::INTERVAL > :cueOut::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':cueOut'=>$cueOut), 'column')) { if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':cueOut'=>$cueOut), 'column')) {
$errArray["error"] = _("Can't set cue in to be larger than cue out."); $errArray["error"] = _("Can't set cue in to be larger than cue out.");
$errArray["type"] = self::CUE_IN_ERROR;
return $errArray; return $errArray;
} }
@ -829,6 +835,7 @@ SQL;
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL"; $sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) { if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
$errArray["error"] = _("Can't set cue out to be greater than file length."); $errArray["error"] = _("Can't set cue out to be greater than file length.");
$errArray["type"] = self::CUE_OUT_ERROR;
return $errArray; return $errArray;
} }
@ -845,6 +852,7 @@ SQL;
$sql = "SELECT :cueIn::INTERVAL > :oldCueOut::INTERVAL"; $sql = "SELECT :cueIn::INTERVAL > :oldCueOut::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':oldCueOut'=>$oldCueOut), 'column')) { if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':oldCueOut'=>$oldCueOut), 'column')) {
$errArray["error"] = _("Can't set cue in to be larger than cue out."); $errArray["error"] = _("Can't set cue in to be larger than cue out.");
$errArray["type"] = self::CUE_IN_ERROR;
return $errArray; return $errArray;
} }
@ -863,6 +871,7 @@ SQL;
$sql = "SELECT :cueOut::INTERVAL < :oldCueIn::INTERVAL"; $sql = "SELECT :cueOut::INTERVAL < :oldCueIn::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':oldCueIn'=>$oldCueIn), 'column')) { if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':oldCueIn'=>$oldCueIn), 'column')) {
$errArray["error"] = _("Can't set cue out to be smaller than cue in."); $errArray["error"] = _("Can't set cue out to be smaller than cue in.");
$errArray["type"] = self::CUE_OUT_ERROR;
return $errArray; return $errArray;
} }
@ -870,6 +879,7 @@ SQL;
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL"; $sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) { if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
$errArray["error"] = _("Can't set cue out to be greater than file length."); $errArray["error"] = _("Can't set cue out to be greater than file length.");
$errArray["type"] = self::CUE_OUT_ERROR;
return $errArray; return $errArray;
} }

View File

@ -144,7 +144,8 @@ var AIRTIME = (function(AIRTIME){
var url = baseUrl+"Playlist/set-cue", var url = baseUrl+"Playlist/set-cue",
lastMod = getModified(), lastMod = getModified(),
type = $('#obj_type').val(), type = $('#obj_type').val(),
li; li,
span;
if (!isTimeValid(cueIn)){ if (!isTimeValid(cueIn)){
$el.find('.cue-in-error').val($.i18n._("please put in a time '00:00:00 (.0)'")).show(); $el.find('.cue-in-error').val($.i18n._("please put in a time '00:00:00 (.0)'")).show();
@ -174,7 +175,27 @@ var AIRTIME = (function(AIRTIME){
return; return;
} }
if (json.cue_error !== undefined) { if (json.cue_error !== undefined) {
showError(span, json.cue_error);
li = $('#side_playlist li[unqid='+id+']');
if (json.code === 0) {
span = $('#spl_cue_in_'+id).find('span');
showError(span, json.cue_error);
span = $('#spl_cue_out_'+id).find('span');
showError(span, json.cue_error);
}
else if (json.code === 1) {
span = $('#spl_cue_in_'+id).find('span');
showError(span, json.cue_error);
}
else if (json.code === 2) {
span = $('#spl_cue_out_'+id).find('span');
showError(span, json.cue_error);
}
return; return;
} }

View File

@ -70,6 +70,11 @@ create_source()
queue = add(!sources, normalize=false) queue = add(!sources, normalize=false)
<<<<<<< HEAD
=======
# the crossfade function controls fade in/out
>>>>>>> 551d65ebf04d877bdba009a92c62bfa4f08eea9c
output.dummy(fallible=true, queue) output.dummy(fallible=true, queue)
http = input.http_restart(id="http") http = input.http_restart(id="http")