]> git.localhorst.tv Git - alttp.git/blobdiff - app/Console/Commands/SyncSpeedGaming.php
use slug for SG twitch channels
[alttp.git] / app / Console / Commands / SyncSpeedGaming.php
index d7f9a63653d9a9b25f7f610861ecdddcc82dfe5c..1b4c80e9a3ea1c83153eb2a61f40e5ca0e11a800 100644 (file)
@@ -42,7 +42,7 @@ class SyncSpeedGaming extends Command {
                $events = Event::where('external_schedule', 'LIKE', 'sg:%')
                        ->where(function (Builder $query) {
                                $query->whereNull('end');
-                               $query->orWhere('end', '<', now());
+                               $query->orWhere('end', '>', now());
                        })
                        ->get();
 
@@ -207,7 +207,7 @@ class SyncSpeedGaming extends Command {
                }
                $channel->short_name = $sgChannel['initials'];
                $channel->title = $sgChannel['name'];
-               $channel->stream_link = 'https://twitch.tv/'.strtolower($sgChannel['name']);
+               $channel->stream_link = 'https://twitch.tv/'.strtolower($sgChannel['slug']);
                $channel->languages = [$sgChannel['language']];
                $channel->save();
                return $channel;