CC-1665: Scheduled stream rebroadcasting and recording
-Better error logging -convert minutes > 59 into hours
This commit is contained in:
parent
b7107fb948
commit
a0ad9a91ea
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue