diff --git a/lib/api/games.ts b/lib/api/games.ts index 931ffb9..26bd61d 100644 --- a/lib/api/games.ts +++ b/lib/api/games.ts @@ -202,7 +202,7 @@ export const gameSyncRoutes = new Elysia({ prefix: "/games" }) return { error: guard.error }; } - let gamesToSync: { id: string; steamAppId: number }[] = []; + let gamesToSync: { id: string; steamAppId: number | null }[] = []; if (body.mode === "all") { gamesToSync = await db @@ -248,6 +248,7 @@ export const gameSyncRoutes = new Elysia({ prefix: "/games" }) let failed = 0; for (const game of gamesToSync) { + if (!game.steamAppId) continue; const result = await syncSteamGame(game.steamAppId, { forceRetry: true }); if (result.success) synced++; else failed++; diff --git a/lib/steam/sync.ts b/lib/steam/sync.ts index 4a2810f..106c247 100644 --- a/lib/steam/sync.ts +++ b/lib/steam/sync.ts @@ -1,6 +1,6 @@ import { db } from "@/lib/db/index" import { games } from "@/lib/db/schema" -import { eq, sql } from "drizzle-orm" +import { eq } from "drizzle-orm" interface SteamAppDetails { steam_appid: number