Skip to content

Commit d39783f

Browse files
committed
dont fetch floatplane status in specialStream unless i actually need to
1 parent d1b74b8 commit d39783f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/routes/api/specialStream/+server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import type { FpEndpointResponse } from "../(live-statuses)/floatplane/+server.t
66
export const GET = (async ({fetch}) => {
77
// In the future this will be from a database, but this will be fine for now. (update a year later: heh)
88

9-
const fpLive: FpEndpointResponse = await fetch("/api/floatplane?fast=true").then(r => r.json());
10-
119
const data: SpecialStream | false = Date.now() > 1742608091103 ? {
1210
title: "Derpy Dinos - Streams with Sarah FP Exclusive",
1311
thumbnail: "https://pbs.floatplane.com/stream_thumbnails/5c13f3c006f1be15e08e05c0/690027088370846_1743099965628.jpeg",
@@ -33,6 +31,8 @@ export const GET = (async ({fetch}) => {
3331
const hideTime = new Date(data.start as string)
3432
hideTime.setHours(hideTime.getHours() + 1.5);
3533

34+
const fpLive: FpEndpointResponse = await fetch("/api/floatplane?fast=true").then(r => r.json());
35+
3636
const timeUntil = getTimeUntil(hideTime);
3737
if(timeUntil.late && !(timeUntil.distance < (2 * 60 * 60e3) && fpLive.isLive)) {
3838
return json(false);

0 commit comments

Comments
 (0)