diff --git a/backend/src/routes/rides.ts b/backend/src/routes/rides.ts index 50b6c82..19799f3 100644 --- a/backend/src/routes/rides.ts +++ b/backend/src/routes/rides.ts @@ -2,7 +2,7 @@ import { Hono } from "hono"; import { PARK_MAP } from "../../../lib/parks"; import { QUEUE_TIMES_IDS } from "../../../lib/queue-times-map"; import { getCoasterSet } from "../../../lib/coaster-data"; -import { getTodayLocal, isWithinOperatingWindow } from "../../../lib/env"; +import { getTodayLocal, getOperatingStatus } from "../../../lib/env"; import { fetchLiveRides } from "../../../lib/scrapers/queuetimes"; import { scrapeRidesForDay } from "../../../lib/scrapers/sixflags"; import { fetchFastLaneWaits, lookupFastLane } from "../../../lib/scrapers/sixflags-waittimes"; @@ -21,9 +21,10 @@ app.get("/:id/rides", async (c) => { const today = getTodayLocal(); const todayData = getDayData(id, today); - const withinWindow = todayData?.hoursLabel - ? isWithinOperatingWindow(todayData.hoursLabel, park.timezone) - : false; + const operatingStatus = todayData?.hoursLabel + ? getOperatingStatus(todayData.hoursLabel, park.timezone) + : "closed"; + const withinWindow = operatingStatus !== "closed"; const queueTimesId = QUEUE_TIMES_IDS[id]; let liveRides: LiveRidesResult | null = null; @@ -90,8 +91,13 @@ app.get("/:id/rides", async (c) => { } } + // Only flag weather delay during scheduled hours — during the post-close + // wind-down buffer, all-rides-closed is just normal closing, not weather. const isWeatherDelay = - withinWindow && liveRides !== null && liveRides.rides.length > 0 && liveRides.rides.every((r) => !r.isOpen); + operatingStatus === "open" && + liveRides !== null && + liveRides.rides.length > 0 && + liveRides.rides.every((r) => !r.isOpen); let scheduleFallback = null; if (!liveRides) {