From c81d1fdfa23976580251110a167f81727d4d4695 Mon Sep 17 00:00:00 2001 From: ilumos Date: Mon, 11 May 2020 20:21:50 +0100 Subject: [PATCH] Remove steam:queue-popular-apps (#31) Steamspy have stopped returning results, likely because of Valve locking down users' play history by default. --- src/Commands/Steam/QueuePopularApps.php | 104 ------------------------ src/Console/Kernel.php | 3 +- 2 files changed, 1 insertion(+), 106 deletions(-) delete mode 100644 src/Commands/Steam/QueuePopularApps.php diff --git a/src/Commands/Steam/QueuePopularApps.php b/src/Commands/Steam/QueuePopularApps.php deleted file mode 100644 index e1deb46..0000000 --- a/src/Commands/Steam/QueuePopularApps.php +++ /dev/null @@ -1,104 +0,0 @@ -argument('top'); - $free = $this->option('free'); - - // Add platforms depending on options - if ($this->option('windows')) { - $platforms[] = 'windows'; - } - - if ($this->option('osx')) { - $platforms[] = 'osx'; - } - - if ($this->option('linux')) { - $platforms[] = 'linux'; - } - - $client = new Client(); - $result = $client->request('GET', self::POPULAR_STEAM_APP_LIST_URL); - - if ($result->getStatusCode() != 200) { - $this->error('Web API unreachable'); - die(); - } - - $apps = json_decode($result->getBody(), true); - - $i = 0; - - foreach ($apps as $appId => $app) { - if ($free && $app['price'] != 0) { - continue; - } - - // Queue each platform separately - foreach ($platforms as $platform) { - - $alreadyQueued = SteamQueueItem::where('app_id', $appId) - ->where('platform', $platform) - ->first(); - - if ($alreadyQueued) { - $this->error('Steam app "'.$app['name'].'" on platform "'.ucfirst($platform).'" already in download queue'); - continue; - } - - // Add the app to the download queue, specifying the platform and account - $steamQueueItem = new SteamQueueItem; - $steamQueueItem->app_id = $appId; - $steamQueueItem->platform = $platform; - $steamQueueItem->status = 'queued'; - - if ($steamQueueItem->save()) { - $this->info('Added Steam app "'.$app['name'].'" on platform "'.ucfirst($platform).'" to download queue'); - } - } - if (++$i == $top) { - break; - } - } - } -} \ No newline at end of file diff --git a/src/Console/Kernel.php b/src/Console/Kernel.php index 23880f2..453ccb4 100644 --- a/src/Console/Kernel.php +++ b/src/Console/Kernel.php @@ -5,7 +5,7 @@ namespace Zeropingheroes\LancacheAutofill\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Zeropingheroes\LancacheAutofill\Commands\Steam\{ - AuthoriseAccount, Dequeue, Initialise, QueueApp, QueuePopularApps, QueueUsersRecentApps, Requeue, SearchApps, ShowQueue, StartDownloading, UpdateAppList + AuthoriseAccount, Dequeue, Initialise, QueueApp, QueueUsersRecentApps, Requeue, SearchApps, ShowQueue, StartDownloading, UpdateAppList }; use Zeropingheroes\LancacheAutofill\Commands\App\{ InitialiseDatabase, InitialiseDownloadsDirectory @@ -26,7 +26,6 @@ class Kernel extends ConsoleKernel UpdateAppList::class, SearchApps::class, QueueApp::class, - QueuePopularApps::class, QueueUsersRecentApps::class, ShowQueue::class, StartDownloading::class,