SAAS-877 - Fix errors

This commit is contained in:
Duncan Sommerville 2015-06-24 13:07:13 -04:00
parent fd8194e7d8
commit ef957fe0aa
1 changed files with 22 additions and 15 deletions

View File

@ -195,8 +195,19 @@ SQL;
$rows = Application_Common_Database::prepareAndExecute($sql, $params);
if ((count($rows) < 1 || $rows[0]["show_ends"] < $utcNow->format(DEFAULT_TIMESTAMP_FORMAT)
&& ($source == self::SCHEDULED_SOURCE_NAME))) { // Only return if the show is using scheduled playback
if ($source != self::SCHEDULED_SOURCE_NAME) {
$show = Application_Model_Show::getCurrentShow();
$results["current"] = array(
"starts" => $show[0]["starts"],
"ends" => $show[0]["ends"],
"type" => _($source . " Stream"),
"name" => (isset($show[0])?$show[0]["name"]:"") . " - " . _($source . " Stream"),
"media_item_played" => false,
"record" => "0"
);
}
if (count($rows) < 1 || $rows[0]["show_ends"] < $utcNow->format(DEFAULT_TIMESTAMP_FORMAT)) {
return $results;
}
@ -231,12 +242,7 @@ SQL;
$currentMediaType = null;
}
if ($source != self::SCHEDULED_SOURCE_NAME) {
$show = Application_Model_Show::getCurrentShow();
$currentMediaName = isset($show[0])?$show[0]["name"]:"";
$currentMediaName .= " - " . _($source . " Stream");
}
if (is_null($results["current"])) {
$results["current"] = array(
"starts" => $currentMedia["starts"],
"ends" => $currentMedia["ends"],
@ -245,6 +251,7 @@ SQL;
"media_item_played" => $currentMedia["media_item_played"],
"record" => "0"
);
}
$previousMedia = CcScheduleQuery::create()
->filterByDbStarts($currentMedia["starts"], Criteria::LESS_THAN)