CC-3639: Preferences-> Fade In is interpreted improperly (it is insanely high)

- the regular exp check in model class was wrong
This commit is contained in:
James 2012-04-13 12:05:59 -04:00
parent ef908ee894
commit 1bb04296a9
4 changed files with 6 additions and 7 deletions

View File

@ -14,7 +14,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$transition_fade = new Zend_Form_Element_Text("transition_fade"); $transition_fade = new Zend_Form_Element_Text("transition_fade");
$transition_fade->setLabel("Switch Transition Fade (s)") $transition_fade->setLabel("Switch Transition Fade (s)")
->setFilters(array('StringTrim')) ->setFilters(array('StringTrim'))
->addValidator('regex', false, array('/^[0-5][0-9](\.\d{1,6})?$/', ->addValidator('regex', false, array('/^[0-9]{1,2}(\.\d{1,6})?$/',
'messages' => 'enter a time in seconds 00{.000000}')) 'messages' => 'enter a time in seconds 00{.000000}'))
->setValue($defaultFade) ->setValue($defaultFade)
->setDecorators(array('ViewHelper')); ->setDecorators(array('ViewHelper'));

View File

@ -321,7 +321,7 @@ class Application_Model_Scheduler {
else { else {
$sched = new CcSchedule(); $sched = new CcSchedule();
} }
Logging::log(print_r($file,true));
$sched->setDbStarts($nextStartDT) $sched->setDbStarts($nextStartDT)
->setDbEnds($endTimeDT) ->setDbEnds($endTimeDT)
->setDbFileId($file['id']) ->setDbFileId($file['id'])

View File

@ -46,7 +46,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
if ($v instanceof DateTime) { if ($v instanceof DateTime) {
$dt = $v; $dt = $v;
} }
else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) { else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v); $dt = DateTime::createFromFormat("s.u", $v);
} }
else { else {
@ -74,7 +74,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
if ($v instanceof DateTime) { if ($v instanceof DateTime) {
$dt = $v; $dt = $v;
} }
else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) { else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v); $dt = DateTime::createFromFormat("s.u", $v);
} }
else { else {

View File

@ -110,7 +110,7 @@ class CcSchedule extends BaseCcSchedule {
if ($v instanceof DateTime) { if ($v instanceof DateTime) {
$dt = $v; $dt = $v;
} }
else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) { else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v); $dt = DateTime::createFromFormat("s.u", $v);
} }
else { else {
@ -120,7 +120,6 @@ class CcSchedule extends BaseCcSchedule {
throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); 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.u');
$this->modifiedColumns[] = CcSchedulePeer::FADE_IN; $this->modifiedColumns[] = CcSchedulePeer::FADE_IN;
@ -138,7 +137,7 @@ class CcSchedule extends BaseCcSchedule {
if ($v instanceof DateTime) { if ($v instanceof DateTime) {
$dt = $v; $dt = $v;
} }
else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) { else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) {
$dt = DateTime::createFromFormat("s.u", $v); $dt = DateTime::createFromFormat("s.u", $v);
} }
else { else {