Aanpassingen layout na feedback

This commit is contained in:
2020-02-15 15:25:04 +01:00
parent 7f5a6ca40e
commit 9baa4a8556
13 changed files with 96 additions and 83 deletions

View File

@@ -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

View File

@@ -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);
});