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->setLabel("Switch Transition Fade (s)")
->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}'))
->setValue($defaultFade)
->setDecorators(array('ViewHelper'));

View File

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

View File

@ -46,7 +46,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
if ($v instanceof DateTime) {
$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);
}
else {
@ -74,7 +74,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
if ($v instanceof DateTime) {
$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);
}
else {

View File

@ -110,7 +110,7 @@ class CcSchedule extends BaseCcSchedule {
if ($v instanceof DateTime) {
$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);
}
else {
@ -120,7 +120,6 @@ 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->modifiedColumns[] = CcSchedulePeer::FADE_IN;
@ -138,7 +137,7 @@ class CcSchedule extends BaseCcSchedule {
if ($v instanceof DateTime) {
$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);
}
else {