feat(playout): replace schedule event dicts with objects
This commit is contained in:
parent
684e7a6f24
commit
a1db2a157a
11 changed files with 646 additions and 667 deletions
|
@ -891,11 +891,9 @@ SQL;
|
|||
$schedule_item = [
|
||||
'id' => $media_id,
|
||||
'type' => 'file',
|
||||
'metadata' => [
|
||||
'track_title' => $fileMetadata['track_title'],
|
||||
'artist_name' => $fileMetadata['artist_name'],
|
||||
'mime' => $fileMetadata['mime'],
|
||||
],
|
||||
'track_title' => $fileMetadata['track_title'],
|
||||
'artist_name' => $fileMetadata['artist_name'],
|
||||
'mime' => $fileMetadata['mime'],
|
||||
'row_id' => $item['id'],
|
||||
'uri' => $uri,
|
||||
'fade_in' => Application_Model_Schedule::WallTimeToMillisecs($item['fade_in']),
|
||||
|
@ -926,25 +924,26 @@ SQL;
|
|||
|
||||
$stream_buffer_start = self::AirtimeTimeToPypoTime($buffer_start->format(DEFAULT_TIMESTAMP_FORMAT));
|
||||
|
||||
$schedule_item = [
|
||||
$schedule_common = [
|
||||
'row_id' => $item['id'],
|
||||
'id' => $media_id,
|
||||
'uri' => $uri,
|
||||
'show_name' => $item['show_name'],
|
||||
];
|
||||
|
||||
$schedule_item = array_merge($schedule_common, [
|
||||
'start' => $stream_buffer_start,
|
||||
'end' => $stream_buffer_start,
|
||||
'uri' => $uri,
|
||||
'row_id' => $item['id'],
|
||||
'type' => 'stream_buffer_start',
|
||||
];
|
||||
]);
|
||||
|
||||
self::appendScheduleItem($data, $start, $schedule_item);
|
||||
|
||||
$schedule_item = [
|
||||
'id' => $media_id,
|
||||
'type' => 'stream_output_start',
|
||||
'row_id' => $item['id'],
|
||||
'uri' => $uri,
|
||||
$schedule_item = array_merge($schedule_common, [
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'show_name' => $item['show_name'],
|
||||
];
|
||||
'type' => 'stream_output_start',
|
||||
]);
|
||||
self::appendScheduleItem($data, $start, $schedule_item);
|
||||
|
||||
// since a stream never ends we have to insert an additional "kick stream" event. The "start"
|
||||
|
@ -954,21 +953,18 @@ SQL;
|
|||
|
||||
$stream_end = self::AirtimeTimeToPypoTime($dt->format(DEFAULT_TIMESTAMP_FORMAT));
|
||||
|
||||
$schedule_item = [
|
||||
$schedule_item = array_merge($schedule_common, [
|
||||
'start' => $stream_end,
|
||||
'end' => $stream_end,
|
||||
'uri' => $uri,
|
||||
'type' => 'stream_buffer_end',
|
||||
'row_id' => $item['id'],
|
||||
];
|
||||
]);
|
||||
self::appendScheduleItem($data, $stream_end, $schedule_item);
|
||||
|
||||
$schedule_item = [
|
||||
$schedule_item = array_merge($schedule_common, [
|
||||
'start' => $stream_end,
|
||||
'end' => $stream_end,
|
||||
'uri' => $uri,
|
||||
'type' => 'stream_output_end',
|
||||
];
|
||||
]);
|
||||
self::appendScheduleItem($data, $stream_end, $schedule_item);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue