feat: use marka api in all apis

This commit is contained in:
Max Richter
2025-10-31 16:23:20 +01:00
parent 79d692c2c6
commit 1f67f8af34
10 changed files with 85 additions and 198 deletions

View File

@@ -5,7 +5,7 @@ import * as tmdb from "@lib/tmdb.ts";
import { fileExtension } from "https://deno.land/x/file_extension@v2.1.0/mod.ts";
import { isString, safeFileName } from "@lib/string.ts";
import { AccessDeniedError } from "@lib/errors.ts";
import { fetchResource } from "@lib/marka.ts";
import { createResource, fetchResource } from "@lib/marka.ts";
export const handler: Handlers = {
async GET(_, ctx) {
@@ -40,7 +40,7 @@ export const handler: Handlers = {
finalPath = `Media/movies/images/${safeFileName(name)
}_cover.${extension}`;
await createDocument(finalPath, poster);
await createResource(finalPath, poster);
}
const metadata = {
@@ -74,7 +74,7 @@ export const handler: Handlers = {
meta: metadata,
};
await createMovie(name, movie);
await createResource(`movies/${safeFileName(name)}.md`, movie);
return json(movie);
},