From: Daniel Karbach Date: Fri, 19 Jun 2026 13:29:08 +0000 (+0200) Subject: actually save tfl title lol X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=HEAD;p=alttp.git actually save tfl title lol --- 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);