From: Daniel Karbach Date: Fri, 11 Jul 2025 13:49:05 +0000 (+0200) Subject: include comms in event description X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=56126780252c3140237714dd5dcb3fe23764be7e;p=alttp.git include comms in event description --- diff --git a/app/Models/Episode.php b/app/Models/Episode.php index c6ac07e..fd68cd6 100644 --- a/app/Models/Episode.php +++ b/app/Models/Episode.php @@ -50,10 +50,13 @@ class Episode extends Model if ($this->title != '') { $parts[] = $this->title; } - if ($this->event->title != '' && strlen(implode(' - ', $parts).' - '.$this->event->title) < 100) { + if ($this->event->title != '') { $parts[] = $this->event->title; } $name = implode(' - ', $parts); + if (strlen($name) > 100) { + $name = substr($name, 0, 99).'…'; + } return $name; } @@ -77,6 +80,23 @@ class Episode extends Model } } } + $comms = []; + foreach ($this->confirmedCrew as $crew) { + if ($crew->role == 'commentary') { + $comms[] = $crew; + } + } + if (count($comms)) { + $description .= "\nComms:\n"; + foreach ($comms as $crew) { + $link = $crew->getStreamLink(); + if ($link) { + $description .= '- ['.$crew->getName().']('.$link.")\n"; + } else { + $description .= '- '.$crew->getName()."\n"; + } + } + } return $description; }