This commit is contained in:
Andreas Hubel 2022-07-01 13:53:30 +02:00
parent 5aa07560bb
commit affc820965
4 changed files with 26 additions and 16 deletions

View file

@ -159,7 +159,7 @@ try {
exit;
}
}
else if(!Conferences::exists($mandator))
else if(false && !Conferences::exists($mandator))
{
// old url OR wrong client OR
// -> error

View file

@ -14,24 +14,32 @@ class ConferenceJson extends Conference
$this->end = DateTime::createFromFormat('c', @$c->end ?: @$c->endDate);
$this->html = @$c->streamingConfig->html ?: [];
$groups = [];
// if ( $c->streamingConfig->overviewPage->sections )
foreach(@$c->streamingConfig->overviewPage->sections as $s) {
$groups[@$s->title] = array_map(
function($r) { return $r->slug; },
@$s->items ?: @$s->rooms ?: []
);
}
$this->rooms = [];
$rooms = @$c->rooms->nodes ?: $c->rooms;
$rooms = property_exists($c->rooms, 'nodes') ? @$c->rooms->nodes : $c->rooms;
foreach($rooms as $r) {
if (!$r) {
continue;
}
$this->rooms[$r->slug] = array_merge(
get_object_vars($r),
@get_object_vars($r->streamingConfig) ?: [],
@get_object_vars($r->streamingConfig->chat) ?: []
);
}
$groups = [];
if ( isset($c->streamingConfig->overviewPage->sections) ) {
foreach(@$c->streamingConfig->overviewPage->sections as $s) {
$groups[@$s->title] = array_map(
function($r) { return $r->slug; },
@$s->items ?: @$s->rooms ?: []
);
}
}
else {
$groups['Live'] = array_keys((array) $rooms);
}
parent::__construct([
'conference' => array_merge([
'title' => $c->title,
@ -138,21 +146,21 @@ class ConferenceJson extends Conference
return array_key_exists('banner', $this->html) && !empty($this->html->banner);
}
public function getBannerHtml() {
return $this->html->banner;
return @$this->html->banner;
}
public function hasFooterHtml() {
return array_key_exists('footer', $this->html) && !empty($this->html->footer);
}
public function getFooterHtml() {
return $this->html->footer;
return @$this->html->footer;
}
public function hasNotStartedHtml() {
return array_key_exists('not_started', $this->html);
}
public function getNotStartedHtml() {
return $this->html->not_started;
return @$this->html->not_started;
}
}

View file

@ -143,7 +143,9 @@ class Conferences
endDate
streamingConfig
rooms(orderBy: [RANK_ASC, NAME_ASC], filter: {streamId: {isNull: false}}) {
rooms(orderBy: [RANK_ASC, NAME_ASC]' . (
false ? ', filter: {streamId: {isNull: false}}' : ''
) . ' ) {
nodes {
guid
name

View file

@ -26,4 +26,4 @@ if [ -z "$(find "configs/upcoming.json" -newermt "8 hours ago")" ]; then
echo
fi
$php_bin -S localhost:$port -d short_open_tag=true index.php
$php_bin -S localhost:$port -d short_open_tag=true $2 index.php