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