From c496fb805b0a4f236de82bb4b075da9acc7e8b06 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Fri, 19 Jun 2026 15:29:08 +0200 Subject: [PATCH] actually save tfl title lol --- app/Console/Commands/SyncTFL.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/SyncTFL.php b/app/Console/Commands/SyncTFL.php index c294740..33f948e 100644 --- a/app/Console/Commands/SyncTFL.php +++ b/app/Console/Commands/SyncTFL.php @@ -93,7 +93,12 @@ class SyncTFL extends Command { $episode->ext_id = $ext_id; $episode->event()->associate($event); } - $episode->title = $tflEntry['name']; + $title_matches = preg_match('/^(.*) \\| ([^|]+) vs\\. ([^|]+) \\| (.*)$/', $tflEntry['name'], $matches); + if ($title_matches) { + $episode->title = $matches[1].' - '.$matches[4]; + } else { + $episode->title = $tflEntry['name']; + } $start = Carbon::createFromFormat('Y-m-d\\T H:i:sP', $tflEntry['start']); if (!$episode->start || $start->ne($episode->start)) { $episode->start = $start; @@ -102,10 +107,9 @@ class SyncTFL extends Command { $episode->confirmed = true; $episode->save(); - if (!preg_match('/^(.*) \\| ([^|]+) vs\\. ([^|]+) \\| (.*)$/', $tflEntry['name'], $matches)) { + if (!$title_matches) { return; } - $episode->title = $matches[1].' - '.$matches[4]; $tflPlayers = [$matches[2], $matches[3]]; $this->purgePlayers($episode, $tflPlayers); -- 2.47.3