Merge branch '2.4.x'

Conflicts:
	airtime_mvc/public/js/airtime/showbuilder/builder.js
	python_apps/pypo/liquidsoap_scripts/fdkaac.liq
	python_apps/pypo/schedule/pypofetch.py
	python_apps/pypo/schedule/telnetliquidsoap.py
This commit is contained in:
Martin Konecny 2013-06-14 16:45:52 -04:00
commit 2a0c9769aa
40 changed files with 3341 additions and 3801 deletions

View file

@ -523,6 +523,15 @@ class ApiController extends Zend_Controller_Action
}
//Updating a metadata change.
else {
//CC-5207 - restart media-monitor causes it to reevaluate all
//files in watched directories, and reset their cue-in/cue-out
//values. Since media-monitor has nothing to do with cue points
//let's unset it here. Note that on mode == "create", we still
//want media-monitor sending info about cue_out which by default
//will be equal to length of track until silan can take over.
unset($md['MDATA_KEY_CUE_IN']);
unset($md['MDATA_KEY_CUE_OUT']);
$file->setMetadata($md);
}
} elseif ($mode == "moved") {

View file

@ -426,6 +426,9 @@ class LibraryController extends Zend_Controller_Action
$request = $this->getRequest();
$file_id = $this->_getParam('id', null);
$file = Application_Model_StoredFile::RecallById($file_id);
@ -438,7 +441,15 @@ class LibraryController extends Zend_Controller_Action
$form->populate($file->getDbColMetadata());
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$js = $this->_getParam('data');
$serialized = array();
//need to convert from serialized jQuery array.
foreach ($js as $j) {
$serialized[$j["name"]] = $j["value"];
}
if ($form->isValid($serialized)) {
$formValues = $this->_getParam('data', null);
$formdata = array();

View file

@ -39,7 +39,7 @@ class Application_Form_EditAudioMD extends Zend_Form
$this->addElement('text', 'track_number', array(
'label' => _('Track:'),
'class' => 'input_text',
'filters' => array('StringTrim')
'filters' => array('StringTrim'),
));
// Add genre field
@ -50,16 +50,17 @@ class Application_Form_EditAudioMD extends Zend_Form
));
// Add year field
$this->addElement('text', 'year', array(
'label' => _('Year:'),
'class' => 'input_text',
'filters' => array('StringTrim'),
'validators' => array(
$year = new Zend_Form_Element_Text('year');
$year->class = 'input_text';
$year->setLabel(_('Year:'))
->setFilters(array('StringTrim'))
->setValidators(array(
new Zend_Validate_StringLength(array('max' => 10)),
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY-MM-DD"),
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY-MM"),
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY")
)
));
));
$this->addElement($year);
// Add label field
$this->addElement('text', 'label', array(

View file

@ -194,14 +194,13 @@ class Application_Model_Scheduler
if ($type === "audioclip") {
$file = CcFilesQuery::create()->findPK($id, $this->con);
$storedFile = new Application_Model_StoredFile($file, $this->con);
if (is_null($file) || !$file->visible()) {
throw new Exception(_("A selected File does not exist!"));
} else {
$data = $this->fileInfo;
$data["id"] = $id;
$data["cliplength"] = $storedFile->getRealClipLength(
$data["cliplength"] = Application_Model_StoredFile::getRealClipLength(
$file->getDbCuein(),
$file->getDbCueout());
@ -840,6 +839,9 @@ class Application_Model_Scheduler
Logging::debug("adjusting all following items.");
Logging::debug(floatval($pend) - floatval($pstart));
}
if ($moveAction) {
$this->calculateCrossfades($instanceId);
}
}//for each instance
}//for each schedule location

View file

@ -778,7 +778,8 @@ SQL;
foreach ($results['aaData'] as &$row) {
$row['id'] = intval($row['id']);
$len_formatter = new LengthFormatter($row['length']);
$len_formatter = new LengthFormatter(
self::getRealClipLength($row["cuein"], $row["cueout"]));
$row['length'] = $len_formatter->format();
$cuein_formatter = new LengthFormatter($row["cuein"]);
@ -1347,7 +1348,7 @@ SQL;
Application_Common_Database::EXECUTE);
}
public function getRealClipLength($p_cuein, $p_cueout) {
public static function getRealClipLength($p_cuein, $p_cueout) {
$sql = "SELECT :cueout::INTERVAL - :cuein::INTERVAL";
return Application_Common_Database::prepareAndExecute($sql, array(

View file

@ -148,6 +148,24 @@ class Application_Service_SchedulerService
return $dt;
}
private static function findTimeDifference($p_startDT, $p_seconds)
{
$startEpoch = $p_startDT->format("U.u");
//add two float numbers to 6 subsecond precision
//DateTime::createFromFormat("U.u") will have a problem if there is no decimal in the resulting number.
$newEpoch = bcsub($startEpoch , (string) $p_seconds, 6);
$dt = DateTime::createFromFormat("U.u", $newEpoch, new DateTimeZone("UTC"));
if ($dt === false) {
//PHP 5.3.2 problem
$dt = DateTime::createFromFormat("U", intval($newEpoch), new DateTimeZone("UTC"));
}
return $dt;
}
public static function fillNewLinkedInstances($ccShow)
{
/* First check if any linked instances have content
@ -224,7 +242,8 @@ class Application_Service_SchedulerService
"{$id}, ".
"{$item["position"]})";
$nextStartDT = $endTimeDT;
$nextStartDT = self::findTimeDifference($endTimeDT,
Application_Model_Preference::GetDefaultCrossfadeDuration());
} //foreach show item
}
} //foreach linked instance
@ -281,7 +300,8 @@ class Application_Service_SchedulerService
->setDbPosition($item->getDbPosition())
->save();
$nextStartDT = $endTimeDT;
$nextStartDT = self::findTimeDifference($endTimeDT,
Application_Model_Preference::GetDefaultCrossfadeDuration());
} //foreach show item
$ccShowInstance