lots of progress

This commit is contained in:
2025-04-12 17:18:33 +03:00
parent 8d230e8e67
commit 3d4260d57e
44 changed files with 2590 additions and 2883 deletions
+2 -6
View File
@@ -40,12 +40,7 @@ class BuildGameLibrary extends Command
$startTimestamp = strtotime("{$year}-01-01");
$endTimestamp = strtotime("{$year}-12-31");
// Generate a random query to get diverse results
$query = $this->generateRandomQuery();
$this->info("Searching for games from {$year} with query: {$query}");
$games = $igdbService->get();
$games = $igdbService->get($limit);
if (empty($games)) {
$this->warn("No games found for this batch. Moving to next batch...");
@@ -66,6 +61,7 @@ class BuildGameLibrary extends Command
$totalAdded++;
} catch (\Exception $e) {
$this->warn("\nFailed to process game: {$e->getMessage()}");
dd($e);
$totalSkipped++;
}
+4 -2
View File
@@ -7,6 +7,7 @@ use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Log;
use JetBrains\PhpStorm\NoReturn;
use ZipArchive;
class FetchIgdbDumps extends Command
@@ -68,6 +69,7 @@ class FetchIgdbDumps extends Command
return Command::SUCCESS;
}
#[NoReturn]
private function fetchDumps(string $type, int $limit, int $offset, string $outputDir, IgdbAuthService $authService): void
{
$endpoint = self::ENDPOINTS[$type];
@@ -81,13 +83,13 @@ class FetchIgdbDumps extends Command
$accessToken = $authService->getAccessToken();
$response = Http::withHeaders([
'Client-ID' => config('services.igdb.credentials.client_id'),
'Client-ID' => config('igdb.credentials.client_id'),
'Authorization' => 'Bearer ' . $accessToken,
])->post($endpoint, [
'fields' => $fields,
'limit' => $limit,
'offset' => $offset,
'where' => 'rating_count > 0',
// 'where' => 'rating_count > 0',
]);
if (!$response->successful()) {