CC-1665: Scheduled stream rebroadcasting and recording

-Better error logging
-convert minutes > 59 into hours
This commit is contained in:
Martin Konecny 2012-08-28 17:22:48 -04:00
parent b7107fb948
commit a0ad9a91ea
2 changed files with 9 additions and 0 deletions

View File

@ -152,6 +152,7 @@ class WebstreamController extends Zend_Controller_Action
throw new Exception("isValid returned false");
}
} catch (Exception $e) {
Logging::debug($e->getMessage());
$this->view->statusMessage = "<div class='errors'>Invalid form values.</div>";
$this->view->streamId = -1;
$this->view->analysis = $analysis;

View File

@ -128,6 +128,8 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
if (!$invalid_date_interval) {
//Due to the way our Regular Expression is set up, we could have $minutes or $hours
//not set. Do simple test here
if (!is_numeric($hours)) {
$hours = 0;
}
@ -135,8 +137,14 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$minutes = 0;
}
//minutes cannot be over 59. Need to convert anything > 59 minutes into hours.
$hours += intval($minutes/60);
$minutes = $minutes%60;
$di = new DateInterval("PT{$hours}H{$minutes}M");
$totalMinutes = $di->h * 60 + $di->i;
if ($totalMinutes == 0) {