CC-1665: Scheduled stream rebroadcasting and recording
-fix creator id on another SQL query
This commit is contained in:
parent
8876b312fb
commit
db36870aec
1 changed files with 47 additions and 42 deletions
|
@ -44,7 +44,7 @@ class Application_Model_Schedule
|
||||||
$previousShowID = count($shows['previousShow'])>0?$shows['previousShow'][0]['instance_id']:null;
|
$previousShowID = count($shows['previousShow'])>0?$shows['previousShow'][0]['instance_id']:null;
|
||||||
$currentShowID = count($shows['currentShow'])>0?$shows['currentShow'][0]['instance_id']:null;
|
$currentShowID = count($shows['currentShow'])>0?$shows['currentShow'][0]['instance_id']:null;
|
||||||
$nextShowID = count($shows['nextShow'])>0?$shows['nextShow'][0]['instance_id']:null;
|
$nextShowID = count($shows['nextShow'])>0?$shows['nextShow'][0]['instance_id']:null;
|
||||||
$results = Application_Model_Schedule::GetPrevCurrentNext($previousShowID, $currentShowID, $nextShowID, $utcTimeNow);
|
$results = self::GetPrevCurrentNext($previousShowID, $currentShowID, $nextShowID, $utcTimeNow);
|
||||||
|
|
||||||
$range = array("env"=>APPLICATION_ENV,
|
$range = array("env"=>APPLICATION_ENV,
|
||||||
"schedulerTime"=>$timeNow,
|
"schedulerTime"=>$timeNow,
|
||||||
|
@ -69,21 +69,26 @@ class Application_Model_Schedule
|
||||||
**/
|
**/
|
||||||
public static function GetPrevCurrentNext($p_previousShowID, $p_currentShowID, $p_nextShowID, $p_timeNow)
|
public static function GetPrevCurrentNext($p_previousShowID, $p_currentShowID, $p_nextShowID, $p_timeNow)
|
||||||
{
|
{
|
||||||
if ($p_previousShowID == null && $p_currentShowID == null && $p_nextShowID == null)
|
if ($p_previousShowID == null && $p_currentShowID == null && $p_nextShowID == null) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
$con = Propel::getConnection();
|
$con = Propel::getConnection();
|
||||||
$sql = "SELECT %%columns%% st.starts as starts, st.ends as ends, st.media_item_played as media_item_played, si.ends as show_ends
|
$sql = "SELECT %%columns%% st.starts as starts, st.ends as ends,
|
||||||
FROM cc_schedule st JOIN %%tables%% LEFT JOIN cc_show_instances si ON st.instance_id = si.id
|
st.media_item_played as media_item_played, si.ends as show_ends
|
||||||
WHERE ";
|
%%tables%% WHERE ";
|
||||||
|
|
||||||
$fileColumns = "ft.artist_name, ft.track_title, ";
|
$fileColumns = "ft.artist_name, ft.track_title, ";
|
||||||
$streamColumns = "ws.creator_id as artist_name, ws.name as track_title, ";
|
//$fileJoin = "cc_files ft ON st.file_id = ft.id";
|
||||||
|
$fileJoin = "FROM cc_schedule st JOIN cc_files ft ON st.file_id = ft.id
|
||||||
|
LEFT JOIN cc_show_instances si ON st.instance_id = si.id";
|
||||||
|
|
||||||
$fileJoin = "cc_files ft ON st.file_id = ft.id";
|
$streamColumns = "sub.login as artist_name, ws.name as track_title, ";
|
||||||
$streamJoin = "cc_webstream ws ON st.stream_id = ws.id";
|
//$streamJoin = "cc_webstream ws ON st.stream_id = ws.id";
|
||||||
|
$streamJoin = "FROM cc_schedule st JOIN cc_webstream ws ON st.stream_id = ws.id
|
||||||
|
LEFT JOIN cc_show_instances si ON st.instance_id = si.id
|
||||||
|
LEFT JOIN cc_subjs as sub on sub.id = ws.creator_id";
|
||||||
|
|
||||||
$predicateArr = array();
|
$predicateArr = array();
|
||||||
if (isset($p_previousShowID)) {
|
if (isset($p_previousShowID)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue