From f9d810eb94bb7b7f2183b0e90e33a01f805a4efc Mon Sep 17 00:00:00 2001 From: Richard Patterson Date: Mon, 22 Apr 2019 14:58:42 +0100 Subject: [PATCH] Expose source status via live-info-v2 endpoint. --- airtime_mvc/application/controllers/ApiController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index cd5027882..1f8283720 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -384,6 +384,15 @@ class ApiController extends Zend_Controller_Action // convert image paths to point to api endpoints WidgetHelper::findAndConvertPaths($result); + // Expose the live source status + $live_dj = Application_Model_Preference::GetSourceSwitchStatus('live_dj') ; + $master_dj = Application_Model_Preference::GetSourceSwitchStatus('master_dj') ; + $scheduled_play = Application_Model_Preference::GetSourceSwitchStatus('scheduled_play') ; + $result["sources"] = array(); + $result["sources"]["livedj"] = $live_dj; + $result["sources"]["masterdj"] = $master_dj; + $result["sources"]["scheduledplay"] = $scheduled_play; + // used by caller to determine if the airtime they are running or widgets in use is out of date. $result["station"]["AIRTIME_API_VERSION"] = AIRTIME_API_VERSION;