From a1b7748759fb04e9eef5e35c5cd3f1d3405c87e7 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 14 Mar 2026 13:57:34 +0200 Subject: [PATCH] Fix "use stagesObj, ensure that has all names on type level" --- .../splatoon-rotations.server.ts | 33 +++---------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/app/features/splatoon-rotations/splatoon-rotations.server.ts b/app/features/splatoon-rotations/splatoon-rotations.server.ts index de6b5e8f5..90d4e3b93 100644 --- a/app/features/splatoon-rotations/splatoon-rotations.server.ts +++ b/app/features/splatoon-rotations/splatoon-rotations.server.ts @@ -1,36 +1,13 @@ import { z } from "zod"; +import gameMisc from "~/../locales/en/game-misc.json"; import type { TablesInsertable } from "~/db/tables"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; import type { RankedModeShort } from "~/modules/in-game-lists/types"; import { SPLATOON3_INK_SCHEDULES_URL } from "~/utils/urls"; -// xxx: use stagesObj, ensure that has all names on type level -const STAGE_NAME_TO_ID: Record = { - "Scorch Gorge": 0, - "Eeltail Alley": 1, - "Hagglefish Market": 2, - "Undertow Spillway": 3, - "Mincemeat Metalworks": 4, - "Hammerhead Bridge": 5, - "Museum d'Alfonsino": 6, - "Mahi-Mahi Resort": 7, - "Inkblot Art Academy": 8, - "Sturgeon Shipyard": 9, - MakoMart: 10, - "Wahoo World": 11, - "Flounder Heights": 12, - "Brinewater Springs": 13, - "Manta Maria": 14, - "Um'ami Ruins": 15, - "Humpback Pump Track": 16, - "Barnacle & Dime": 17, - "Crableg Capital": 18, - "Shipshape Cargo Co.": 19, - "Bluefin Depot": 20, - "Robo ROM-en": 21, - "Marlin Airport": 22, - "Lemuria Hub": 23, - "Urchin Underpass": 24, -}; +const STAGE_NAME_TO_ID = Object.fromEntries( + stageIds.map((id) => [gameMisc[`STAGE_${id}` as keyof typeof gameMisc], id]), +) as Record; const RULE_TO_MODE: Record = { AREA: "SZ",