Expose source status via live-info-v2 endpoint.

This commit is contained in:
Richard Patterson 2019-04-22 14:58:42 +01:00
parent 063e554100
commit f9d810eb94
1 changed files with 9 additions and 0 deletions

View File

@ -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;