CC-3091: Widget "Today's Program" doesn't show any content
It's not showing anything because I thought it's not suppose to display the currently playing show. Fixed by retrieving the currently playing show along with next shows, and display them. todayInfoAction is no longer needed since liveInfoAction does the same thing.
This commit is contained in:
parent
37da2bf0c5
commit
161fa80d64
|
@ -203,32 +203,6 @@ class ApiController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function todayInfoAction()
|
|
||||||
{
|
|
||||||
if (Application_Model_Preference::GetAllow3rdPartyApi()){
|
|
||||||
// disable the view and the layout
|
|
||||||
$this->view->layout()->disableLayout();
|
|
||||||
$this->_helper->viewRenderer->setNoRender(true);
|
|
||||||
|
|
||||||
$date = new Application_Model_DateHelper;
|
|
||||||
$utcTimeNow = $date->getUtcTimestamp();
|
|
||||||
$utctimeEnd = Application_Model_DateHelper::GetDayEndTimestampInUtc();
|
|
||||||
|
|
||||||
$result = array("env"=>APPLICATION_ENV,
|
|
||||||
"schedulerTime"=>gmdate("Y-m-d H:i:s"),
|
|
||||||
"nextShow"=>Application_Model_Show::GetNextShows($utcTimeNow, 5, $utcTimeEnd));
|
|
||||||
|
|
||||||
Application_Model_Show::ConvertToLocalTimeZone($result["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
|
|
||||||
|
|
||||||
header("Content-type: text/javascript");
|
|
||||||
echo $_GET['callback'].'('.json_encode($result).')';
|
|
||||||
} else {
|
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
|
||||||
print 'You are not allowed to access this resource. ';
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function weekInfoAction()
|
public function weekInfoAction()
|
||||||
{
|
{
|
||||||
if (Application_Model_Preference::GetAllow3rdPartyApi()){
|
if (Application_Model_Preference::GetAllow3rdPartyApi()){
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
getServerData();
|
getServerData();
|
||||||
|
|
||||||
function updateWidget(){
|
function updateWidget(){
|
||||||
var shows = sd.getNextShows();
|
var currentShow = sd.getCurrentShow();
|
||||||
|
var nextShows = sd.getNextShows();
|
||||||
|
var shows = currentShow.length == 0 ? nextShows : currentShow.concat(nextShows);
|
||||||
|
|
||||||
tableString = "";
|
tableString = "";
|
||||||
tableString += "<h3>" + options.text.onAirToday + "</h3>";
|
tableString += "<h3>" + options.text.onAirToday + "</h3>";
|
||||||
|
@ -50,7 +52,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function getServerData(){
|
function getServerData(){
|
||||||
$.ajax({ url: options.sourceDomain + "api/today-info/", dataType:"jsonp", success:function(data){
|
$.ajax({ url: options.sourceDomain + "api/live-info/", dataType:"jsonp", success:function(data){
|
||||||
processData(data);
|
processData(data);
|
||||||
}, error:airtimeScheduleJsonpError});
|
}, error:airtimeScheduleJsonpError});
|
||||||
setTimeout(getServerData, options.updatePeriod*1000);
|
setTimeout(getServerData, options.updatePeriod*1000);
|
||||||
|
|
Loading…
Reference in New Issue