From df6e2325d995ab60ee0894f5155049e8cd3e492d Mon Sep 17 00:00:00 2001 From: creations Date: Sun, 20 Apr 2025 14:39:31 -0400 Subject: [PATCH] fix lint --- public/js/index.js | 6 ++++-- src/routes/[id].ts | 4 +++- src/routes/api/art[game].ts | 36 ++++++++++++++++++++++++------------ src/routes/index.ts | 6 +++++- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index 998bb3d..a734d1f 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -248,7 +248,7 @@ function buildActivityHTML(activity) { ${activity.assets?.large_text ? `title="${activity.assets.large_text}"` : ""} /> ${``} - ` + `; return `
  • @@ -431,7 +431,9 @@ function updatePresence(data) { } async function getAllNoAsset() { - const noAssetImages = document.querySelectorAll("img.activity-image.no-asset"); + const noAssetImages = document.querySelectorAll( + "img.activity-image.no-asset", + ); console.log("Images with .no-asset:", noAssetImages.length, noAssetImages); diff --git a/src/routes/[id].ts b/src/routes/[id].ts index a6524ff..a4b8769 100644 --- a/src/routes/[id].ts +++ b/src/routes/[id].ts @@ -11,7 +11,9 @@ const routeDef: RouteDef = { async function handler(request: ExtendedRequest): Promise { const { id } = request.params; - const data: LanyardResponse = await getLanyardData(id || lanyardConfig.userId); + const data: LanyardResponse = await getLanyardData( + id || lanyardConfig.userId, + ); if (!data.success) { return await renderEjsTemplate("error", { diff --git a/src/routes/api/art[game].ts b/src/routes/api/art[game].ts index 3a945f6..05aa342 100644 --- a/src/routes/api/art[game].ts +++ b/src/routes/api/art[game].ts @@ -17,11 +17,14 @@ async function fetchSteamGridIcon(gameName: string): Promise { const cached = await redis.get(cacheKey); if (cached) return cached; - const search = await fetch(`https://www.steamgriddb.com/api/v2/search/autocomplete/${encodeURIComponent(gameName)}`, { - headers: { - Authorization: `Bearer ${steamGridDbKey}`, + const search = await fetch( + `https://www.steamgriddb.com/api/v2/search/autocomplete/${encodeURIComponent(gameName)}`, + { + headers: { + Authorization: `Bearer ${steamGridDbKey}`, + }, }, - }); + ); if (!search.ok) return null; @@ -31,11 +34,14 @@ async function fetchSteamGridIcon(gameName: string): Promise { const gameId = data[0]?.id; if (!gameId) return null; - const iconRes = await fetch(`https://www.steamgriddb.com/api/v2/icons/game/${gameId}`, { - headers: { - Authorization: `Bearer ${steamGridDbKey}`, + const iconRes = await fetch( + `https://www.steamgriddb.com/api/v2/icons/game/${gameId}`, + { + headers: { + Authorization: `Bearer ${steamGridDbKey}`, + }, }, - }); + ); if (!iconRes.ok) return null; @@ -53,20 +59,26 @@ async function handler(request: ExtendedRequest): Promise { if (!steamGridDbKey) { return Response.json( { status: 503, error: "Route disabled due to missing SteamGridDB key" }, - { status: 503 } + { status: 503 }, ); } const { game } = request.params; if (!game || typeof game !== "string" || game.length < 2) { - return Response.json({ status: 400, error: "Missing or invalid game name" }, { status: 400 }); + return Response.json( + { status: 400, error: "Missing or invalid game name" }, + { status: 400 }, + ); } const icon = await fetchSteamGridIcon(game); if (!icon) { - return Response.json({ status: 404, error: "Icon not found" }, { status: 404 }); + return Response.json( + { status: 404, error: "Icon not found" }, + { status: 404 }, + ); } return Response.json( @@ -75,7 +87,7 @@ async function handler(request: ExtendedRequest): Promise { game, icon, }, - { status: 200 } + { status: 200 }, ); } diff --git a/src/routes/index.ts b/src/routes/index.ts index d6109cd..e3b78cb 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -4,6 +4,10 @@ export const routeDef = { ...idRouteDef, }; -export const handler = async (request: ExtendedRequest, body: unknown, server: BunServer) => { +export const handler = async ( + request: ExtendedRequest, + body: unknown, + server: BunServer, +) => { return await idHandler(request); };