feat: trying to add hashes to scripts

This commit is contained in:
Max Richter
2026-01-10 13:03:13 +01:00
parent e65938ecc2
commit e55f787a29
79 changed files with 4209 additions and 720 deletions

View File

@@ -1,12 +1,16 @@
import { Handlers } from "$fresh/server.ts";
import { json } from "@lib/helpers.ts";
import * as tmdb from "@lib/tmdb.ts";
import { fileExtension } from "https://deno.land/x/file_extension@v2.1.0/mod.ts";
import { formatDate, isString, safeFileName } from "@lib/string.ts";
import {
fileExtension,
formatDate,
isString,
safeFileName,
} from "@lib/string.ts";
import { AccessDeniedError, BadRequestError } from "@lib/errors.ts";
import { createResource, fetchResource } from "@lib/marka/index.ts";
import { ReviewResource } from "@lib/marka/schema.ts";
import { toUrlSafeString } from "@lib/string.ts";
import { define } from "../../../utils.ts";
function pickDirector(
credits: Awaited<ReturnType<typeof tmdb.getSeriesCredits>>,
@@ -16,12 +20,12 @@ function pickDirector(
return crewDirector?.name ?? createdBy?.[0]?.name;
}
export const handler: Handlers = {
async GET(_, ctx) {
export const handler = define.handlers({
async GET(ctx) {
const series = await fetchResource(`series/${ctx.params.name}`);
return json(series);
},
async POST(_, ctx) {
async POST(ctx) {
const session = ctx.state.session;
if (!session) {
throw new AccessDeniedError();
@@ -78,4 +82,4 @@ export const handler: Handlers = {
return json({ name: fileName });
},
};
});