From 5df7f3ed455c56370b3c4b690b0ca47b183fa829 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Sat, 8 Jun 2024 00:13:13 +0200 Subject: [PATCH] add up to 4 player support for zsr sync --- app/Console/Commands/SyncZSR.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/SyncZSR.php b/app/Console/Commands/SyncZSR.php index 65b21c1..b7719e2 100644 --- a/app/Console/Commands/SyncZSR.php +++ b/app/Console/Commands/SyncZSR.php @@ -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]); -- 2.39.2