Merge pull request #800 from detobate/master

Expose source status via live-info-v2 endpoint.
This commit is contained in:
Robb 2019-04-22 12:37:15 -04:00 committed by GitHub
commit 9fb3dc6d9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -384,6 +384,15 @@ class ApiController extends Zend_Controller_Action
// convert image paths to point to api endpoints // convert image paths to point to api endpoints
WidgetHelper::findAndConvertPaths($result); 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. // 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; $result["station"]["AIRTIME_API_VERSION"] = AIRTIME_API_VERSION;