Changes before go-live

This commit is contained in:
2020-02-26 21:37:32 +01:00
parent c572f8b711
commit 1b1f4d4ebc
5 changed files with 50 additions and 20 deletions

View File

@@ -78,11 +78,13 @@ class RadioController extends Controller
public function terugluisteren(Request $request)
{
$programs = [];
$now = new \DateTimeImmutable('2 minutes ago');
$apiResult = $this->API('programma/schema/recent');
foreach($apiResult->schedule as $item) {
if(!$item->program->nonstop && !$item->program->rerun) {
$item->start = self::JsonToDateTime($item->start);
$item->end = self::JsonToDateTime($item->end);
$item->current = $item->end >= $now;
$item->program = new \Model\Program($item->program);
$programs[] = $item;
}