How to make available Airtime show status using API (v2.5.1)
  • The live-info api does not allow to know the status of airtime (Scheduled show, DJ show or Master show).
    My hack add that to le live-info json reply.

    For that, you have to modify the file: .../airtime/application/controllers/ApiController.php

    Near line 309, replace:

    //used by caller to determine if the airtime they are running or widgets in use is out of date.
    $result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION;
    header("Content-Type: application/json");

    by

    //used by caller to determine if the airtime they are running or widgets in use is out of date.
    $result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION;
    //Airtime live 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['livedj'] = $live_dj;
    $result['masterdj'] = $master_dj;
    $result['scheduledplay'] = $scheduled_play;
    header("Content-Type: application/json");

    You now have the status inside json api:
    {........."AIRTIME_API_VERSION":"1.1","livedj":"off","masterdj":"off","scheduledplay":"on"}

    Regards,
    Gael
    Post edited by Gael Rambaud at 2016-07-11 10:32:40