Aanpassingen layout na feedback
This commit is contained in:
@@ -38,11 +38,12 @@ class Kernel extends ConsoleKernel
|
||||
// Update now / later
|
||||
$schedule->call(function() {
|
||||
Storage::disk('local')->put('nu_straks.json', file_get_contents($this->API_URL . 'programma/schema/nustraks'));
|
||||
Storage::disk('local')->put('zojuist.json', file_get_contents($this->API_URL . 'programma/schema/recent'));
|
||||
})->everyMinute();
|
||||
|
||||
// Update latest podcasts (3 items)
|
||||
// Update latest podcasts (6 items)
|
||||
$schedule->call(function() {
|
||||
Storage::disk('local')->put('laatste_podcasts.json', file_get_contents($this->API_URL . 'podcast/overzicht?pagina=1&aantal=3'));
|
||||
Storage::disk('local')->put('laatste_podcasts.json', file_get_contents($this->API_URL . 'podcast/overzicht?pagina=1&aantal=6'));
|
||||
})->everyMinute();
|
||||
|
||||
// Update calendar items
|
||||
|
||||
@@ -52,6 +52,18 @@ class Controller extends BaseController
|
||||
$program->end = new \DateTimeImmutable($item_data->end->date, new \DateTimeZone($item_data->end->timezone));
|
||||
}
|
||||
|
||||
$now = new \DateTimeImmutable();
|
||||
$data = json_decode(Storage::disk('local')->get('zojuist.json'))->schedule;
|
||||
foreach(array_reverse($data) as $item_data)
|
||||
{
|
||||
$recent = $program = new \Model\Program($item_data->program);
|
||||
$recent->start = new \DateTimeImmutable($item_data->start->date, new \DateTimeZone($item_data->start->timezone));
|
||||
$recent->end = new \DateTimeImmutable($item_data->end->date, new \DateTimeZone($item_data->end->timezone));
|
||||
if(($recent->end < $now) && (!$recent->nonstop) && (!$recent->rerun)) {
|
||||
$view->with('recent', $recent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$view->with('data', $programs);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user