Merge pull request #734 from mikeopensauce/726apionairfix

Bugfix for #726. Fixes onAirLightAction returning 500 error
This commit is contained in:
Kyle Robbertze 2019-02-17 18:45:10 +02:00 committed by GitHub
commit e13fc6b3d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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" ||