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

This commit is contained in:
Martin Konecny 2012-10-17 15:28:15 -04:00
commit 7123230eea
23 changed files with 147 additions and 68 deletions

View file

@ -16,12 +16,12 @@ class Application_Model_PlayoutHistory
private $opts;
private $mDataPropMap = array(
"artist" => "file.artist_name",
"title" => "file.track_title",
"played" => "playout.played",
"length" => "file.length",
"composer" => "file.composer",
"copyright" => "file.copyright",
"artist" => "artist_name",
"title" => "track_title",
"played" => "played",
"length" => "length",
"composer" => "composer",
"copyright" => "copyright",
);
public function __construct($p_startDT, $p_endDT, $p_opts)

View file

@ -892,22 +892,22 @@ class Application_Model_Preference
return (strlen($val) == 0) ? 0 : $val;
}
public static function SetLiveSteamMasterUsername($value)
public static function SetLiveStreamMasterUsername($value)
{
self::setValue("live_stream_master_username", $value, false);
}
public static function GetLiveSteamMasterUsername()
public static function GetLiveStreamMasterUsername()
{
return self::getValue("live_stream_master_username");
}
public static function SetLiveSteamMasterPassword($value)
public static function SetLiveStreamMasterPassword($value)
{
self::setValue("live_stream_master_password", $value, false);
}
public static function GetLiveSteamMasterPassword()
public static function GetLiveStreamMasterPassword()
{
return self::getValue("live_stream_master_password");
}
@ -1093,7 +1093,7 @@ class Application_Model_Preference
public static function getOrderingMap($pref_param)
public static function getOrderingMap($pref_param)
{
$v = self::getValue($pref_param, true);

View file

@ -196,6 +196,10 @@ class Application_Model_StoredFile
if (isset($this->_dbMD[$dbColumn])) {
$propelColumn = $this->_dbMD[$dbColumn];
$method = "set$propelColumn";
/* We need to set track_number to null if it is an empty string
* because propel defaults empty strings to zeros */
if ($dbColumn == "track_number" && empty($mdValue)) $mdValue = null;
$this->_file->$method($mdValue);
}
}

View file

@ -5,7 +5,7 @@
/**
* Skeleton subclass for representing a row from the 'cc_blockcontents' table.
*
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
@ -44,11 +44,16 @@ class CcBlockcontents extends BaseCcBlockcontents {
*/
public function setDbFadein($v)
{
$microsecond = 0;
if ($v instanceof DateTime) {
$dt = $v;
}
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v);
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
// Hence we need to do parsing.
$info = explode('.', $v);
$microsecond = $info[1];
$dt = DateTime::createFromFormat("s", $info[0]);
}
else {
try {
@ -58,7 +63,7 @@ class CcBlockcontents extends BaseCcBlockcontents {
}
}
$this->fadein = $dt->format('H:i:s.u');
$this->fadein = $dt->format('H:i:s').".".$microsecond;
$this->modifiedColumns[] = CcBlockcontentsPeer::FADEIN;
return $this;
@ -72,11 +77,16 @@ class CcBlockcontents extends BaseCcBlockcontents {
*/
public function setDbFadeout($v)
{
$microsecond = 0;
if ($v instanceof DateTime) {
$dt = $v;
}
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v);
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
// Hence we need to do parsing.
$info = explode('.', $v);
$microsecond = $info[1];
$dt = DateTime::createFromFormat("s", $info[0]);
}
else {
try {
@ -86,7 +96,7 @@ class CcBlockcontents extends BaseCcBlockcontents {
}
}
$this->fadeout = $dt->format('H:i:s.u');
$this->fadeout = $dt->format('H:i:s').".".$microsecond;
$this->modifiedColumns[] = CcBlockcontentsPeer::FADEOUT;
return $this;

View file

@ -43,11 +43,16 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
*/
public function setDbFadein($v)
{
$microsecond = 0;
if ($v instanceof DateTime) {
$dt = $v;
}
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v);
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
// Hence we need to do parsing.
$info = explode('.', $v);
$microsecond = $info[1];
$dt = DateTime::createFromFormat("s", $info[0]);
}
else {
try {
@ -57,7 +62,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
}
}
$this->fadein = $dt->format('H:i:s.u');
$this->fadein = $dt->format('H:i:s').".".$microsecond;
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
return $this;
@ -71,11 +76,16 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
*/
public function setDbFadeout($v)
{
$microsecond = 0;
if ($v instanceof DateTime) {
$dt = $v;
}
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v);
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
// Hence we need to do parsing.
$info = explode('.', $v);
$microsecond = $info[1];
$dt = DateTime::createFromFormat("s", $info[0]);
}
else {
try {
@ -85,7 +95,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
}
}
$this->fadeout = $dt->format('H:i:s.u');
$this->fadeout = $dt->format('H:i:s').".".$microsecond;
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
return $this;

View file

@ -107,11 +107,16 @@ class CcSchedule extends BaseCcSchedule {
*/
public function setDbFadeIn($v)
{
$microsecond = 0;
if ($v instanceof DateTime) {
$dt = $v;
}
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v);
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
// Hence we need to do parsing.
$info = explode('.', $v);
$microsecond = $info[1];
$dt = DateTime::createFromFormat("s", $info[0]);
}
else {
try {
@ -120,7 +125,7 @@ class CcSchedule extends BaseCcSchedule {
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
}
}
$this->fade_in = $dt->format('H:i:s.u');
$this->fade_in = $dt->format('H:i:s').".".$microsecond;
$this->modifiedColumns[] = CcSchedulePeer::FADE_IN;
return $this;
@ -134,11 +139,16 @@ class CcSchedule extends BaseCcSchedule {
*/
public function setDbFadeOut($v)
{
$microsecond = 0;
if ($v instanceof DateTime) {
$dt = $v;
}
else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v);
// in php 5.3.2 createFromFormat() with "u" is not supported(bug)
// Hence we need to do parsing.
$info = explode('.', $v);
$microsecond = $info[1];
$dt = DateTime::createFromFormat("s", $info[0]);
}
else {
try {
@ -148,7 +158,7 @@ class CcSchedule extends BaseCcSchedule {
}
}
$this->fade_out = $dt->format('H:i:s.u');
$this->fade_in = $dt->format('H:i:s').".".$microsecond;
$this->modifiedColumns[] = CcSchedulePeer::FADE_OUT;
return $this;