Upgrade Fresh and add a bunch of small QOL improvements #16

Merged
timharek merged 21 commits from chore-upgrade-fresh into main 2024-03-24 12:41:18 +00:00
2 changed files with 6 additions and 12 deletions
Showing only changes of commit 353466992f - Show all commits

View File

@ -1,6 +1,5 @@
import { Episode, nrkRadio } from "../../../lib/nrk.ts"; import { Episode, nrkRadio } from "../../../lib/nrk.ts";
import { HandlerContext } from "$fresh/server.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 { declaration, serialize, tag } from "https://raw.githubusercontent.com/olaven/serialize-xml/v0.4.0/mod.ts";
import { getHostName } from "../../../utils.ts"; import { getHostName } from "../../../utils.ts";
@ -87,11 +86,8 @@ async function buildFeed(seriesId: string) {
); );
} }
export const handler = async ( export const handler = async (_req: Request, ctx: HandlerContext): Promise<Response> => {
req: Request, const seriesId = ctx.params.seriesId;
_ctx: HandlerContext,
): Promise<Response> => {
const seriesId = _ctx.params.seriesId;
const feedContent = await buildFeed(seriesId); const feedContent = await buildFeed(seriesId);
return new Response(feedContent, { return new Response(feedContent, {

View File

@ -7,12 +7,10 @@ function toChapters(episode: OriginalEpisode) {
startTime: toSeconds(parse(indexPoint.startPoint)), startTime: toSeconds(parse(indexPoint.startPoint)),
})); }));
} }
export const handler = async (
req: Request, export const handler = async (_req: Request, ctx: HandlerContext): Promise<Response> => {
_ctx: HandlerContext, const seriesId = ctx.params.seriesId;
): Promise<Response> => { const episodeId = ctx.params.episodeId;
const seriesId = _ctx.params.seriesId;
const episodeId = _ctx.params.episodeId;
console.log("going to get ep for ", episodeId); console.log("going to get ep for ", episodeId);
const episode = await nrkRadio.getEpisode(seriesId, episodeId); const episode = await nrkRadio.getEpisode(seriesId, episodeId);