]> git.localhorst.tv Git - alttp.git/commitdiff
add up to 4 player support for zsr sync
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 7 Jun 2024 22:13:13 +0000 (00:13 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 7 Jun 2024 22:13:13 +0000 (00:13 +0200)
app/Console/Commands/SyncZSR.php

index 65b21c187dbfaa4982bcce5105dec419939fb761..b7719e25c244f53e0b0452bc785e1b0e4a0cd46c 100644 (file)
@@ -95,7 +95,20 @@ class SyncZSR extends Command {
                $end = Carbon::parse($entry['end']['dateTime'])->setTimezone('UTC');
                $episode->estimate = $start->diffInSeconds($end);
                $episode->confirmed = true;
-               if (preg_match('/^(.*) - (.*?) vs\.? (.*?)$/u', $episode->title, $matches)) {
+               if (preg_match('/^(.*) - (.*?) vs\.? (.*?) vs\.? (.*?) vs\.? (.*?)$/u', $episode->title, $matches)) {
+                       $episode->title = $matches[1];
+                       $episode->save();
+                       $this->syncPlayer($episode, $matches[2]);
+                       $this->syncPlayer($episode, $matches[3]);
+                       $this->syncPlayer($episode, $matches[4]);
+                       $this->syncPlayer($episode, $matches[5]);
+               } else if (preg_match('/^(.*) - (.*?) vs\.? (.*?) vs\.? (.*?)$/u', $episode->title, $matches)) {
+                       $episode->title = $matches[1];
+                       $episode->save();
+                       $this->syncPlayer($episode, $matches[2]);
+                       $this->syncPlayer($episode, $matches[3]);
+                       $this->syncPlayer($episode, $matches[4]);
+               } else if (preg_match('/^(.*) - (.*?) vs\.? (.*?)$/u', $episode->title, $matches)) {
                        $episode->title = $matches[1];
                        $episode->save();
                        $this->syncPlayer($episode, $matches[2]);