Bug fix on air.txt

This commit is contained in:
2021-01-04 20:55:54 +01:00
parent 444ad56464
commit 9144cc5b06

View File

@@ -281,15 +281,16 @@ QUERY;
$activeStudioQuery = app('db')->select("SELECT `studio` FROM `programs_schedule_webcam` WHERE `active` = 1"); $activeStudioQuery = app('db')->select("SELECT `studio` FROM `programs_schedule_webcam` WHERE `active` = 1");
if(!count($activeStudioQuery) || !($activeStudio = $activeStudioQuery[0]->studio)) { if(!count($activeStudioQuery) || !($activeStudio = $activeStudioQuery[0]->studio)) {
$activeStudio = 'nonstop'; $activeStudio = null;
} $current = null;
} else {
$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);
if($current->isLayout() /* || $current->secondsRemaining() < 0 */) { if($current->isLayout() /* || $current->secondsRemaining() < 0 */) {
if(!$next->isLayout()) { if(!$next->isLayout()) {
$current = $next; $current = $next;
}
} }
} }
@@ -314,7 +315,7 @@ QUERY;
$activeStudioQuery = app('db')->select("SELECT `studio` FROM `programs_schedule_webcam` WHERE `active` = 1"); $activeStudioQuery = app('db')->select("SELECT `studio` FROM `programs_schedule_webcam` WHERE `active` = 1");
if(!count($activeStudioQuery) || !($activeStudio = $activeStudioQuery[0]->studio)) { if(!count($activeStudioQuery) || !($activeStudio = $activeStudioQuery[0]->studio)) {
$activeStudio = 'nonstop'; $activeStudio = $program->nonstop ? 'nonstop' : null;
} }
$text = []; $text = [];
@@ -332,7 +333,7 @@ QUERY;
} }
} }
if(!$request->get('program_only', false) && !($current->isLayout())) { if($current && !$request->get('program_only', false) && !($current->isLayout())) {
if($current->title) $text[] = $current->title; if($current->title) $text[] = $current->title;
if($current->artist) $text[] = $currenet->artist; if($current->artist) $text[] = $currenet->artist;
} }