OnAir gefixt

This commit is contained in:
2021-01-04 21:37:45 +01:00
parent 9144cc5b06
commit 67e8184fc5

View File

@@ -279,11 +279,18 @@ QUERY;
$schema = $this->createSchedule($start, $einde); $schema = $this->createSchedule($start, $einde);
$program = $schema['schedule'][0]['program']; $program = $schema['schedule'][0]['program'];
$activeStudioQuery = app('db')->select("SELECT `studio` FROM `programs_schedule_webcam` WHERE `active` = 1"); $activeStudio = null;
if(!count($activeStudioQuery) || !($activeStudio = $activeStudioQuery[0]->studio)) { $current = null;
$activeStudio = null; if($program->nonstop) {
$current = null; $activeStudio = 'nonstop';
} else { } else {
$activeStudioQuery = app('db')->select("SELECT `studio` FROM `programs_schedule_webcam` WHERE `active` = 1");
if(count($activeStudioQuery)) {
$activeStudio = $activeStudioQuery[0]->studio;
}
}
if($activeStudio) {
$current = $this->getTrack($activeStudio); $current = $this->getTrack($activeStudio);
$next = $this->getTrack($activeStudio, /* next: */ true); $next = $this->getTrack($activeStudio, /* next: */ true);
$current->ends($next->start); $current->ends($next->start);
@@ -319,9 +326,7 @@ QUERY;
} }
$text = []; $text = [];
if(!$program->nonstop) { $current = null;
$text[] = $program->name;
}
if($activeStudio) { if($activeStudio) {
$current = $this->getTrack($activeStudio); $current = $this->getTrack($activeStudio);
@@ -332,11 +337,18 @@ QUERY;
$current = $next; $current = $next;
} }
} }
if($current && !$request->get('program_only', false) && !($current->isLayout())) {
if($current->title) $text[] = $current->title;
if($current->artist) $text[] = $currenet->artist;
} }
if($request->get('program_only', false)) {
return $program->name;
}
if(!$request->get('program_only', false)) {
if(!$program->nonstop) $text[] = $program->name;
if($current && !$current->isLayout()) {
if($current->artist) $text[] = $current->artist;
if($current->title) $text[] = $current->title;
}
} }
return join(' - ', $text); return join(' - ', $text);