chore: deno fmt

This commit is contained in:
Max Richter
2025-11-02 21:58:02 +01:00
parent 21124dfe00
commit c13420c3ab
41 changed files with 324 additions and 254 deletions

View File

@@ -62,10 +62,11 @@ function parseParams(reqUrl: URL): ImageParams | string {
// Helper function to generate ETag
async function generateETag(content: ArrayBuffer): Promise<string> {
const hashBuffer = await crypto.subtle.digest("SHA-256", content);
return `"${Array.from(new Uint8Array(hashBuffer))
return `"${
Array.from(new Uint8Array(hashBuffer))
.map((b) => b.toString(16).padStart(2, "0"))
.join("")
}"`;
}"`;
}
async function GET(req: Request, _ctx: FreshContext): Promise<Response> {

View File

@@ -70,8 +70,9 @@ async function processCreateRecipeFromUrl(
if (newRecipe?.image && newRecipe.image.length > 5) {
const extension = fileExtension(new URL(newRecipe.image).pathname);
const finalPath = `resources/recipes/images/${safeFileName(id)
}_cover.${extension}`;
const finalPath = `resources/recipes/images/${
safeFileName(id)
}_cover.${extension}`;
streamResponse.enqueue("downloading image");
try {
streamResponse.enqueue("downloading image");

View File

@@ -42,7 +42,8 @@ async function processUpdateRecommendations(
}
done++;
streamResponse.enqueue(
`${Math.floor((done / total) * 100)}% [${done + 1
`${Math.floor((done / total) * 100)}% [${
done + 1
}/${total}] ${movie.name}`,
);
})).catch((err) => {

View File

@@ -46,7 +46,7 @@ const POST = async (
}
const posterPath = seriesDetails.poster_path;
const director = seriesCredits &&
seriesCredits.crew?.filter?.((person) => person.job === "Director")[0] ||
seriesCredits.crew?.filter?.((person) => person.job === "Director")[0] ||
seriesDetails?.created_by?.[0];
if (director && director.name && !series.meta?.author) {
series.author = series.author || {};