diff --git a/lib/api/game-stats.ts b/lib/api/game-stats.ts index 9a814e8..fecd55a 100644 --- a/lib/api/game-stats.ts +++ b/lib/api/game-stats.ts @@ -112,16 +112,19 @@ export const gameStatsRoutes = new Elysia({ prefix: "/games", detail: { tags: [" .where(eq(gameVersions.gameId, gameId)) const versionCount = versionRow?.count ?? 0 - // ── 3. Raw Performer check ──────────────────────────────────── - const isRawPerformer = entries.some( + // ── 3. Raw Performer check (handheld devices only) ───────────── + const handheldEntries = entries.filter((e) => + e.hardwareSlug.startsWith("steamdeck"), + ) + const isRawPerformer = handheldEntries.some( (e) => (e.fpsAvg ?? 0) >= 60 && e.upscalerType === "none" && e.frameGenMethod === "none", ) - // ── 3b. Poor Performance check ───────────────────────────────── - const isPoorPerformance = entries.some((e) => (e.fpsAvg ?? 0) < 30) + // ── 3b. Poor Performance check (handheld devices only) ───────── + const isPoorPerformance = handheldEntries.some((e) => (e.fpsAvg ?? 0) < 30) // ── 4. Boxplot per device ───────────────────────────────────── const boxplotMap = new Map< diff --git a/lib/api/games-listing.ts b/lib/api/games-listing.ts index ada3a7b..c5f435b 100644 --- a/lib/api/games-listing.ts +++ b/lib/api/games-listing.ts @@ -378,6 +378,10 @@ export const gamesListingRoutes = new Elysia({ prefix: "/games/listing", detail: }) .from(performanceEntries) .innerJoin(gameVersions, eq(performanceEntries.versionId, gameVersions.id)) + .innerJoin(hardware, and( + eq(performanceEntries.hardwareSlug, hardware.slug), + eq(hardware.deviceType, "handheld"), + )) .where( and( inArray(gameVersions.gameId, gameIds), diff --git a/lib/api/search-unified.ts b/lib/api/search-unified.ts index 3fdec51..9ab8d68 100644 --- a/lib/api/search-unified.ts +++ b/lib/api/search-unified.ts @@ -5,6 +5,7 @@ import { gameVersions, performanceEntries, gameComments, + hardware, } from "@/lib/db/schema" import { ilike, or, sql, eq, inArray, and, gte, desc } from "drizzle-orm" import { fuzzySearchTerm } from "@/lib/db/search" @@ -308,6 +309,10 @@ export const searchUnifiedRoutes = new Elysia({ prefix: "/search", detail: { tag gameVersions, eq(performanceEntries.versionId, gameVersions.id), ) + .innerJoin(hardware, and( + eq(performanceEntries.hardwareSlug, hardware.slug), + eq(hardware.deviceType, "handheld"), + )) .where( and( inArray(gameVersions.gameId, finalIds),