fix: scope performance tags (Raw Performer/Poor Performance) to handheld devices only
This commit is contained in:
@@ -112,16 +112,19 @@ export const gameStatsRoutes = new Elysia({ prefix: "/games", detail: { tags: ["
|
|||||||
.where(eq(gameVersions.gameId, gameId))
|
.where(eq(gameVersions.gameId, gameId))
|
||||||
const versionCount = versionRow?.count ?? 0
|
const versionCount = versionRow?.count ?? 0
|
||||||
|
|
||||||
// ── 3. Raw Performer check ────────────────────────────────────
|
// ── 3. Raw Performer check (handheld devices only) ─────────────
|
||||||
const isRawPerformer = entries.some(
|
const handheldEntries = entries.filter((e) =>
|
||||||
|
e.hardwareSlug.startsWith("steamdeck"),
|
||||||
|
)
|
||||||
|
const isRawPerformer = handheldEntries.some(
|
||||||
(e) =>
|
(e) =>
|
||||||
(e.fpsAvg ?? 0) >= 60 &&
|
(e.fpsAvg ?? 0) >= 60 &&
|
||||||
e.upscalerType === "none" &&
|
e.upscalerType === "none" &&
|
||||||
e.frameGenMethod === "none",
|
e.frameGenMethod === "none",
|
||||||
)
|
)
|
||||||
|
|
||||||
// ── 3b. Poor Performance check ─────────────────────────────────
|
// ── 3b. Poor Performance check (handheld devices only) ─────────
|
||||||
const isPoorPerformance = entries.some((e) => (e.fpsAvg ?? 0) < 30)
|
const isPoorPerformance = handheldEntries.some((e) => (e.fpsAvg ?? 0) < 30)
|
||||||
|
|
||||||
// ── 4. Boxplot per device ─────────────────────────────────────
|
// ── 4. Boxplot per device ─────────────────────────────────────
|
||||||
const boxplotMap = new Map<
|
const boxplotMap = new Map<
|
||||||
|
|||||||
@@ -378,6 +378,10 @@ export const gamesListingRoutes = new Elysia({ prefix: "/games/listing", detail:
|
|||||||
})
|
})
|
||||||
.from(performanceEntries)
|
.from(performanceEntries)
|
||||||
.innerJoin(gameVersions, eq(performanceEntries.versionId, gameVersions.id))
|
.innerJoin(gameVersions, eq(performanceEntries.versionId, gameVersions.id))
|
||||||
|
.innerJoin(hardware, and(
|
||||||
|
eq(performanceEntries.hardwareSlug, hardware.slug),
|
||||||
|
eq(hardware.deviceType, "handheld"),
|
||||||
|
))
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
inArray(gameVersions.gameId, gameIds),
|
inArray(gameVersions.gameId, gameIds),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
gameVersions,
|
gameVersions,
|
||||||
performanceEntries,
|
performanceEntries,
|
||||||
gameComments,
|
gameComments,
|
||||||
|
hardware,
|
||||||
} from "@/lib/db/schema"
|
} from "@/lib/db/schema"
|
||||||
import { ilike, or, sql, eq, inArray, and, gte, desc } from "drizzle-orm"
|
import { ilike, or, sql, eq, inArray, and, gte, desc } from "drizzle-orm"
|
||||||
import { fuzzySearchTerm } from "@/lib/db/search"
|
import { fuzzySearchTerm } from "@/lib/db/search"
|
||||||
@@ -308,6 +309,10 @@ export const searchUnifiedRoutes = new Elysia({ prefix: "/search", detail: { tag
|
|||||||
gameVersions,
|
gameVersions,
|
||||||
eq(performanceEntries.versionId, gameVersions.id),
|
eq(performanceEntries.versionId, gameVersions.id),
|
||||||
)
|
)
|
||||||
|
.innerJoin(hardware, and(
|
||||||
|
eq(performanceEntries.hardwareSlug, hardware.slug),
|
||||||
|
eq(hardware.deviceType, "handheld"),
|
||||||
|
))
|
||||||
.where(
|
.where(
|
||||||
and(
|
and(
|
||||||
inArray(gameVersions.gameId, finalIds),
|
inArray(gameVersions.gameId, finalIds),
|
||||||
|
|||||||
Reference in New Issue
Block a user