Always pass program in onAir
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
@@ -261,21 +260,22 @@ QUERY;
|
||||
$einde = new \DateTimeImmutable('now + 1 second');
|
||||
$schema = $this->createSchedule($start, $einde);
|
||||
$program = $schema['schedule'][0]['program'];
|
||||
|
||||
if($program->nonstop) {
|
||||
$current = $this->getTrack();
|
||||
$next = $this->getTrack(/* next: */ true);
|
||||
$current->ends($next->start);
|
||||
if($current->isLayout() /* || $current->secondsRemaining() < 0 */) {
|
||||
if($next->isLayout()) {
|
||||
return response()->json(['inProgram' => true, 'current' => $program->name]);
|
||||
return response()->json(['inProgram' => true, 'program' => $program]);
|
||||
}
|
||||
|
||||
$current = $next;
|
||||
}
|
||||
|
||||
return response()->json(['inProgram' => false, 'current' => $current]);
|
||||
return response()->json(['inProgram' => false, 'current' => $current, 'program' => $program]);
|
||||
} else {
|
||||
return response()->json(['inProgram' => true, 'current' => $program->name]);
|
||||
return response()->json(['inProgram' => true, 'program' => $program]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user