X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FConsole%2FCommands%2FSyncSpeedGaming.php;h=d7f9a63653d9a9b25f7f610861ecdddcc82dfe5c;hb=b98dac4d596e4bed9a5f96526aa66ea8512ad2ab;hp=610968e631f6fc0d66b49978ce817c018b8b108d;hpb=dc004b57a3d95d29dbf8a06a07df43f603eec6be;p=alttp.git diff --git a/app/Console/Commands/SyncSpeedGaming.php b/app/Console/Commands/SyncSpeedGaming.php index 610968e..d7f9a63 100644 --- a/app/Console/Commands/SyncSpeedGaming.php +++ b/app/Console/Commands/SyncSpeedGaming.php @@ -125,7 +125,7 @@ class SyncSpeedGaming extends Command { $this->purgeChannels($episode, $sgEntry); $channelIds = []; foreach ($sgEntry['channels'] as $sgChannel) { - if ($sgChannel['initials'] == 'NONE') continue; + if ($sgChannel['initials'] == 'NONE' || $sgChannel['name'] == 'Undecided, Not SG') continue; try { $channel = $this->syncChannel($episode, $sgChannel); $channelIds[] = $channel->id; @@ -317,10 +317,14 @@ class SyncSpeedGaming extends Command { } if (!empty($player['discordTag'])) { $tag = explode('#', $player['discordTag']); - $user = User::firstWhere([ - ['username', 'LIKE', $tag[0]], - ['discriminator', '=', $tag[1]], - ]); + $user = count($tag) < 2 || $tag[1] == '0' + ? User::firstWhere([ + ['username', 'LIKE', $tag[0]], + ]) + : User::firstWhere([ + ['username', 'LIKE', $tag[0]], + ['discriminator', '=', $tag[1]], + ]); if ($user) return $user; } return null;