This commit is contained in:
2017-08-03 21:30:56 +02:00
parent 34a37d3abd
commit f48e5c7faf
2 changed files with 12 additions and 1 deletions

View File

@@ -184,7 +184,7 @@ QUERY;
{
$start = new \DateTimeImmutable(urldecode($from));
$end = new \DateTimeImmutable(urldecode($to));
$this->createSchedule($start, $end, true);
print '<pre>' . json_encode($this->createSchedule($start, $end, true)) . '</pre>';
}
@@ -230,6 +230,16 @@ QUERY;
return response()->json($program);
}
/**
* Programmas nu en straks (24 uur vooruit)
*/
public function onair() {
$start = new \DateTimeImmutable('now');
$einde = new \DateTimeImmutable('now + 1 second');
$schema = $this->createSchedule($start, $einde);
return response()->json(['current' => ['program' => true, 'name' => $schema['schedule'][0]['program']->name]]);
}
/**
* Programmas nu en straks (24 uur vooruit)
*/

View File

@@ -27,6 +27,7 @@ $app->get('podcast/programma/{id:\d+}', 'PodcastController@program' );
$app->get('podcast/download/{id:\d+}/{title}', 'PodcastController@download' );
$app->get('podcast/stream/{id:\d+}/{title}', 'PodcastController@stream' );
$app->get('programma/schema/onair', 'ProgramController@onair' );
$app->get('programma/schema/nustraks', 'ProgramController@comingup' );
$app->get('programma/schema/week[/{shiftWeeks:-?\d+}]', 'ProgramController@schedule' );
$app->get('programma/details/{id:\d+}', 'ProgramController@details' );