]> git.localhorst.tv Git - alttp.git/commitdiff
dirty hack for team events
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 6 Jul 2025 14:53:38 +0000 (16:53 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sun, 6 Jul 2025 14:53:38 +0000 (16:53 +0200)
app/Models/Episode.php

index e0789a818014f9c41a2b3e0572f4b208448ee083..df2418a403a744248cdb2a5ea107f009a3e1893a 100644 (file)
@@ -38,7 +38,9 @@ class Episode extends Model
 
        public function getScheduledEventName(): string {
                $parts = [];
-               if (count($this->players) > 1) {
+               if (count($this->players) == 4) {
+                       // $parts[] = $this->players[0]->getName().' and '.$this->players[2]->getName().' vs '.$this->players[1]->getName().' and '.$this->players[3]->getName();
+               } elseif (count($this->players) > 1) {
                        $players = [];
                        foreach ($this->players as $player) {
                                $players[] = $player->getName();
@@ -55,10 +57,15 @@ class Episode extends Model
        }
 
        public function getScheduledEventDescription(): string {
+               $description = '';
+               if (count($this->players) == 4) {
+                       $description .= $this->players[0]->getName().' and '.$this->players[2]->getName()
+                               .' vs '.$this->players[1]->getName().' and '.$this->players[3]->getName()."\n";
+               }
                if ($this->comment != '') {
-                       return $this->comment;
+                       $description .= $this->comment."\n";
                }
-               return '';
+               return $description;
        }
 
        public function getRestreamLink(string $preferred_lang = ''): string {