misc fixes

This commit is contained in:
Andreas Hubel 2022-12-27 12:46:16 +01:00
parent 05c773f8b8
commit 36a6ee344f
5 changed files with 24 additions and 8 deletions

View file

@ -38,6 +38,12 @@ else
$GLOBALS['CONFIG']['BASEURL'] = '//streaming.media.ccc.de/';
}
/**
* Wenn die Konfiguration einer Konferenz/Mandant nicht im Dateisystem gefunden wird:
* Soll die Streamingwebseite versuchen diese bei data.c3voc.de per API abzufragen?
*/
$GLOBALS['CONFIG']['DYNAMIC_LOOKUP'] = false;
/**
* Konfiguration für den Datei-Download Cronjob
@ -103,7 +109,10 @@ $GLOBALS['CONFIG']['FEEDBACK'] = array(
*/
$GLOBALS['CONFIG']['ROOM_DEFAULTS'] = array(
'WIDE' => true,
/**
* Breite Teaser in der Übersichtsseite
*/
'WIDE' => false,
/**
* Stream-Vorschaubildchen auf der Übersichtsseite anzeigen

View file

@ -205,9 +205,9 @@ try {
'conference_assets' => forceslash($mandator),
'conference' => $conference,
'feedback' => $conference->getFeedback(),
'schedule' => $conference->getSchedule(),
'subtitles' => $conference->getSubtitles(),
'feedback' => $conference ? $conference->getFeedback() : false,
'schedule' => $conference ? $conference->getSchedule() : false,
'subtitles' => $conference ? $conference->getSubtitles() : false,
));
// ALWAYS AVAILABLE ROUTES

View file

@ -15,7 +15,7 @@ class ConferenceJson extends Conference
$this->html = @$c->streamingConfig->html ?: [];
$this->rooms = [];
$rooms = is_array(@$c->rooms) ? $c->rooms : @$c->rooms->nodes;
$rooms = (is_array(@$c->rooms) ? $c->rooms : @$c->rooms->nodes) ?: [];
foreach($rooms as $r) {
if (!$r) {
continue;

View file

@ -132,6 +132,11 @@ class Conferences
return new Conference($config, $mandator);
}
// config option for dynamic lookup feature defined below
if (!@$GLOBALS['CONFIG']['DYNAMIC_LOOKUP']) {
return false;
}
// otherwise try to find conference in c3data postgres
$query = 'query StreamingConfig($acronym: String!) {
conference(acronym: $acronym) {

View file

@ -53,15 +53,17 @@ function formatRooms($conference) {
unset($config['guid']);
unset($config['name']);
unset($config['slug']);
foreach ($config['chat'] as $k => $v) {
unset($config[$k]);
if (isset($config['chat'])) {
foreach ($config['chat'] as $k => $v) {
unset($config[$k]);
}
}
$struct[] = array(
'guid' => $room->getId(),
'slug' => $room->getSlug(),
'name' => $room->get('name') ?: $room->getScheduleName(),
'name' => /*$room->get('name') ?: */ $room->getScheduleName(),
'stream' => $room->getStream(),
'streamingConfig' => $config ? lowerCaseKeys($config) : null,
);