Bugfix for #726. Fixes onAirLightAction returning 500 error

This commit is contained in:
Your Name 2019-02-10 09:58:10 +00:00
parent 17e12f023d
commit 7f69b1adf1
1 changed files with 74 additions and 73 deletions

View File

@ -178,6 +178,7 @@ class ApiController extends Zend_Controller_Action
//Used by the SaaS monitoring
public function onAirLightAction()
{
$request = $this->getRequest();
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
@ -188,9 +189,9 @@ class ApiController extends Zend_Controller_Action
$range = Application_Model_Schedule::GetPlayOrderRange();
$isItemCurrentlyScheduled = !is_null($range["current"]) && count($range["currentShow"]) > 0 ? true : false;
$isItemCurrentlyScheduled = !is_null($range["tracks"]["current"]) && count($range["tracks"]["current"]) > 0 ? true : false;
$isCurrentItemPlaying = $range["current"]["media_item_played"] ? true : false;
$isCurrentItemPlaying = $range["tracks"]["current"]["media_item_played"] ? true : false;
if ($isItemCurrentlyScheduled ||
Application_Model_Preference::GetSourceSwitchStatus("live_dj") == "on" ||