Merge branch '2.3.x' into devel

This commit is contained in:
denise 2013-02-13 16:09:53 -05:00
commit ec159131a8
57 changed files with 4238 additions and 429 deletions

View file

@ -257,6 +257,10 @@ SQL;
//format original length
$formatter = new LengthFormatter($row['orig_length']);
$row['orig_length'] = $formatter->format();
// XSS exploit prevention
$row["track_title"] = htmlspecialchars($row["track_title"]);
$row["creator"] = htmlspecialchars($row["creator"]);
}
return $rows;
@ -399,10 +403,13 @@ SQL;
$entry = $this->blockItem;
$entry["id"] = $file->getDbId();
$entry["pos"] = $pos;
$entry["cliplength"] = $file->getDbLength();
$entry["cueout"] = $file->getDbCueout();
$entry["cuein"] = $file->getDbCuein();
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']);
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']);
$entry["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cue_out-$cue_in);
return $entry;
} else {
throw new Exception("trying to add a file that does not exist.");
@ -1299,7 +1306,7 @@ SQL;
foreach ($out as $crit) {
$criteria = $crit->getDbCriteria();
$modifier = $crit->getDbModifier();
$value = $crit->getDbValue();
$value = htmlspecialchars($crit->getDbValue());
$extra = $crit->getDbExtra();
if ($criteria == "limit") {

View file

@ -269,6 +269,10 @@ SQL;
//format original length
$formatter = new LengthFormatter($row['orig_length']);
$row['orig_length'] = $formatter->format();
// XSS exploit prevention
$row["track_title"] = htmlspecialchars($row["track_title"]);
$row["creator"] = htmlspecialchars($row["creator"]);
}
return $rows;
@ -398,6 +402,13 @@ SQL;
if ($obj instanceof CcFiles && $obj) {
$entry["cuein"] = $obj->getDbCuein();
$entry["cueout"] = $obj->getDbCueout();
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($entry['cueout']);
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($entry['cuein']);
$entry["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cue_out-$cue_in);
} elseif ($obj instanceof CcWebstream && $obj) {
$entry["cuein"] = "00:00:00";
$entry["cueout"] = $entry["cliplength"];
}
$entry["ftype"] = $objType;
}

View file

@ -203,9 +203,12 @@ class Application_Model_Scheduler
$file = CcFilesQuery::create()->findPk($fileId);
if (isset($file) && $file->visible()) {
$data["id"] = $file->getDbId();
$data["cliplength"] = $file->getDbLength();
$data["cuein"] = "00:00:00";
$data["cueout"] = $file->getDbLength();
$data["cuein"] = $file->getDbCuein();
$data["cueout"] = $file->getDbCueout();
$cuein = Application_Common_DateHelper::calculateLengthInSeconds($data["cuein"]);
$cueout = Application_Common_DateHelper::calculateLengthInSeconds($data["cueout"]);
$data["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
$defaultFade = Application_Model_Preference::GetDefaultFade();
if (isset($defaultFade)) {
//fade is in format SS.uuuuuu
@ -261,9 +264,12 @@ class Application_Model_Scheduler
$file = CcFilesQuery::create()->findPk($fileId);
if (isset($file) && $file->visible()) {
$data["id"] = $file->getDbId();
$data["cliplength"] = $file->getDbLength();
$data["cuein"] = "00:00:00";
$data["cueout"] = $file->getDbLength();
$data["cuein"] = $file->getDbCuein();
$data["cueout"] = $file->getDbCueout();
$cuein = Application_Common_DateHelper::calculateLengthInSeconds($data["cuein"]);
$cueout = Application_Common_DateHelper::calculateLengthInSeconds($data["cueout"]);
$data["cliplength"] = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein);
$defaultFade = Application_Model_Preference::GetDefaultFade();
if (isset($defaultFade)) {
//fade is in format SS.uuuuuu
@ -325,6 +331,8 @@ class Application_Model_Scheduler
$filler->setDbStarts($DT)
->setDbEnds($this->nowDT)
->setDbClipLength($cliplength)
->setDbCueIn('00:00:00')
->setDbCueOut('00:00:00')
->setDbPlayoutStatus(-1)
->setDbInstanceId($instance->getDbId())
->save($this->con);

View file

@ -275,9 +275,9 @@ class Application_Model_ShowBuilder
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
$row['runtime'] = $formatter->format();
$row["title"] = $p_item["file_track_title"];
$row["creator"] = $p_item["file_artist_name"];
$row["album"] = $p_item["file_album_title"];
$row["title"] = htmlspecialchars($p_item["file_track_title"]);
$row["creator"] = htmlspecialchars($p_item["file_artist_name"]);
$row["album"] = htmlspecialchars($p_item["file_album_title"]);
$row["cuein"] = $p_item["cue_in"];
$row["cueout"] = $p_item["cue_out"];

View file

@ -1024,8 +1024,10 @@ SQL;
$LIQUIDSOAP_ERRORS = array('TagLib: MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream.');
// Ask Liquidsoap if file is playable
$command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' 2>&1", $audio_file);
$ls_command = sprintf('/usr/bin/airtime-liquidsoap -v -c "output.dummy(audio_to_stereo(single(%s)))" 2>&1',
escapeshellarg($audio_file));
$command = "export PATH=/usr/local/bin:/usr/bin:/bin/usr/bin/ && $ls_command";
exec($command, $output, $rv);
$isError = count($output) > 0 && in_array($output[0], $LIQUIDSOAP_ERRORS);

View file

@ -46,8 +46,8 @@ class CcScheduleTableMap extends TableMap {
$this->addColumn('CLIP_LENGTH', 'DbClipLength', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('FADE_IN', 'DbFadeIn', 'TIME', false, null, '00:00:00');
$this->addColumn('FADE_OUT', 'DbFadeOut', 'TIME', false, null, '00:00:00');
$this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('CUE_IN', 'DbCueIn', 'VARCHAR', true, null, null);
$this->addColumn('CUE_OUT', 'DbCueOut', 'VARCHAR', true, null, null);
$this->addColumn('MEDIA_ITEM_PLAYED', 'DbMediaItemPlayed', 'BOOLEAN', false, null, false);
$this->addForeignKey('INSTANCE_ID', 'DbInstanceId', 'INTEGER', 'cc_show_instances', 'ID', true, null, null);
$this->addColumn('PLAYOUT_STATUS', 'DbPlayoutStatus', 'SMALLINT', true, null, 1);

View file

@ -77,14 +77,12 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
/**
* The value for the cue_in field.
* Note: this column has a database default value of: '00:00:00'
* @var string
*/
protected $cue_in;
/**
* The value for the cue_out field.
* Note: this column has a database default value of: '00:00:00'
* @var string
*/
protected $cue_out;
@ -161,8 +159,6 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$this->clip_length = '00:00:00';
$this->fade_in = '00:00:00';
$this->fade_out = '00:00:00';
$this->cue_in = '00:00:00';
$this->cue_out = '00:00:00';
$this->media_item_played = false;
$this->playout_status = 1;
$this->broadcasted = 0;
@ -708,7 +704,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->cue_in !== $v || $this->isNew()) {
if ($this->cue_in !== $v) {
$this->cue_in = $v;
$this->modifiedColumns[] = CcSchedulePeer::CUE_IN;
}
@ -728,7 +724,7 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
$v = (string) $v;
}
if ($this->cue_out !== $v || $this->isNew()) {
if ($this->cue_out !== $v) {
$this->cue_out = $v;
$this->modifiedColumns[] = CcSchedulePeer::CUE_OUT;
}
@ -842,14 +838,6 @@ abstract class BaseCcSchedule extends BaseObject implements Persistent
return false;
}
if ($this->cue_in !== '00:00:00') {
return false;
}
if ($this->cue_out !== '00:00:00') {
return false;
}
if ($this->media_item_played !== false) {
return false;
}