CC-2098: Only push playlists that havent ended yet

-re-added ability to specify to/from time ranges
This commit is contained in:
martin 2011-03-28 18:23:57 -04:00
parent d6c8e8ca3d
commit d745201afe
1 changed files with 15 additions and 8 deletions

View File

@ -653,17 +653,24 @@ class Schedule {
* @param string $p_toDateTime
* In the format "YYYY-MM-DD-HH-mm-SS"
*/
public static function GetScheduledPlaylists()
public static function GetScheduledPlaylists($p_fromDateTime = null, $p_toDateTime = null)
{
global $CC_CONFIG, $CC_DBC;
$t1 = new DateTime();
$range_start = $t1->format("Y-m-d H:i:s");
$t2 = new DateTime();
$t2->add(new DateInterval("PT24H"));
$range_end = $t2->format("Y-m-d H:i:s");
if (is_null($p_fromDateTime)) {
$t1 = new DateTime();
$range_start = $t1->format("Y-m-d H:i:s");
} else {
$range_start = Schedule::PypoTimeToAirtimeTime($p_fromDateTime);
}
if (is_null($p_fromDateTime)) {
$t2 = new DateTime();
$t2->add(new DateInterval("PT24H"));
$range_end = $t2->format("Y-m-d H:i:s");
} else {
$range_end = Schedule::PypoTimeToAirtimeTime($p_toDateTime);
}
// Scheduler wants everything in a playlist
$data = Schedule::GetItems($range_start, $range_end, true);
$playlists = array();