From 353466992fbaf14b56f06b82003144d5ff1767d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20H=C3=A5rek=20Andreassen?= Date: Sat, 2 Mar 2024 18:17:46 +0100 Subject: [PATCH] fix: Context is used, should not be set as a unused var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim HÄrek Andreassen --- routes/api/feeds/[seriesId].ts | 8 ++------ routes/api/feeds/[seriesId]/[episodeId]/chapters.ts | 10 ++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/routes/api/feeds/[seriesId].ts b/routes/api/feeds/[seriesId].ts index 731a2b2..703a581 100644 --- a/routes/api/feeds/[seriesId].ts +++ b/routes/api/feeds/[seriesId].ts @@ -1,6 +1,5 @@ import { Episode, nrkRadio } from "../../../lib/nrk.ts"; import { HandlerContext } from "$fresh/server.ts"; - import { declaration, serialize, tag } from "https://raw.githubusercontent.com/olaven/serialize-xml/v0.4.0/mod.ts"; import { getHostName } from "../../../utils.ts"; @@ -87,11 +86,8 @@ async function buildFeed(seriesId: string) { ); } -export const handler = async ( - req: Request, - _ctx: HandlerContext, -): Promise => { - const seriesId = _ctx.params.seriesId; +export const handler = async (_req: Request, ctx: HandlerContext): Promise => { + const seriesId = ctx.params.seriesId; const feedContent = await buildFeed(seriesId); return new Response(feedContent, { diff --git a/routes/api/feeds/[seriesId]/[episodeId]/chapters.ts b/routes/api/feeds/[seriesId]/[episodeId]/chapters.ts index 55b4879..7a2b26d 100644 --- a/routes/api/feeds/[seriesId]/[episodeId]/chapters.ts +++ b/routes/api/feeds/[seriesId]/[episodeId]/chapters.ts @@ -7,12 +7,10 @@ function toChapters(episode: OriginalEpisode) { startTime: toSeconds(parse(indexPoint.startPoint)), })); } -export const handler = async ( - req: Request, - _ctx: HandlerContext, -): Promise => { - const seriesId = _ctx.params.seriesId; - const episodeId = _ctx.params.episodeId; + +export const handler = async (_req: Request, ctx: HandlerContext): Promise => { + const seriesId = ctx.params.seriesId; + const episodeId = ctx.params.episodeId; console.log("going to get ep for ", episodeId); const episode = await nrkRadio.getEpisode(seriesId, episodeId);