From d79a2605ed03fd5b731e06d4a565b0442d9c79a1 Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Wed, 29 Apr 2026 11:46:35 +0800 Subject: [PATCH] fix: resolve type errors and lint warnings in sync system --- lib/api/games.ts | 3 ++- lib/steam/sync.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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