]> git.localhorst.tv Git - alttp.git/commitdiff
parse sg alttpr league title format
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 19 Jun 2026 13:21:40 +0000 (15:21 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 19 Jun 2026 13:21:40 +0000 (15:21 +0200)
app/Console/Commands/SyncSpeedGaming.php

index c2a02bde4c80013f376d7014fc71fb381114bf8a..362ee6f24712051ab7ab818014ce8d2d0f760bb7 100644 (file)
@@ -102,6 +102,10 @@ class SyncSpeedGaming extends Command {
                }
                $episode->event()->associate($event);
                $episode->title = $sgEntry['match1']['title'];
+               if (preg_match('/^(.*)_(.*)__(.*)$/', $sgEntry['match1']['title'], $matches)) {
+                       // league format
+                       $episode->title = $matches[1].' vs. '.$matches[2].' - '.$matches[3];
+               }
                $start = Carbon::createFromFormat('Y-m-d\TH:i:sP', $sgEntry['when']);
                if ($event->fix_timezone && !$episode->timezone_fix_override) {
                        $sg_zone = new \DateTimeZone('America/Detroit');