]> git.localhorst.tv Git - alttp.git/blobdiff - app/Console/Commands/SyncZSR.php
add up to 4 player support for zsr sync
[alttp.git] / 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]);