chore: deno fmt
This commit is contained in:
@@ -42,7 +42,7 @@ function LogLine(
|
||||
<span class="bg-gray-600 py-1 px-2 text-xs rounded-xl text-white">
|
||||
{log.date.getHours().toString().padStart(2, "0")}:{log.date
|
||||
.getMinutes().toString().padStart(2, "0")}:{log.date.getSeconds()
|
||||
.toString().padStart(2, "0")} {formatDate(log.date)}
|
||||
.toString().padStart(2, "0")} {formatDate(log.date)}
|
||||
</span>
|
||||
<span class="bg-gray-600 py-1 px-2 text-xs rounded-xl text-white">
|
||||
{log.scope}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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 || {};
|
||||
|
||||
@@ -12,15 +12,16 @@ import { MetaTags } from "@components/MetaTags.tsx";
|
||||
import { fetchResource } from "@lib/marka/index.ts";
|
||||
import { ArticleResource } from "@lib/marka/schema.ts";
|
||||
|
||||
export const handler: Handlers<{ article: ArticleResource; session: unknown }> = {
|
||||
async GET(_, ctx) {
|
||||
const article = await fetchResource(`articles/${ctx.params.name}.md`);
|
||||
if (!article) {
|
||||
return ctx.renderNotFound();
|
||||
}
|
||||
return ctx.render({ article, session: ctx.state.session });
|
||||
},
|
||||
};
|
||||
export const handler: Handlers<{ article: ArticleResource; session: unknown }> =
|
||||
{
|
||||
async GET(_, ctx) {
|
||||
const article = await fetchResource(`articles/${ctx.params.name}.md`);
|
||||
if (!article) {
|
||||
return ctx.renderNotFound();
|
||||
}
|
||||
return ctx.render({ article, session: ctx.state.session });
|
||||
},
|
||||
};
|
||||
|
||||
export default function Greet(
|
||||
props: PageProps<{ article: Article; session: Record<string, string> }>,
|
||||
|
||||
@@ -22,10 +22,11 @@ export default function Home(props: PageProps) {
|
||||
<Card
|
||||
title={`${m.name}`}
|
||||
backgroundSize={80}
|
||||
image={`${m.emoji.endsWith(".png")
|
||||
image={`${
|
||||
m.emoji.endsWith(".png")
|
||||
? `/emojis/${encodeURIComponent(m.emoji)}`
|
||||
: "/placeholder.svg"
|
||||
}`}
|
||||
}`}
|
||||
link={m.link}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -24,7 +24,7 @@ export default async function Greet(
|
||||
return ctx.renderNotFound();
|
||||
}
|
||||
|
||||
const { author = "", datePublished = "",reviewBody } = movie.content;
|
||||
const { author = "", datePublished = "", reviewBody } = movie.content;
|
||||
|
||||
const content = renderMarkdown(
|
||||
removeImage(reviewBody || "", movie.content.image),
|
||||
|
||||
@@ -21,7 +21,7 @@ export default async function MovieIndex(
|
||||
await searchResource({ ...searchParams, types: ["movie"] });
|
||||
const movies = allMovies.sort((a, b) =>
|
||||
a?.content?.reviewRating?.ratingValue >
|
||||
b?.content?.reviewRating?.ratingValue
|
||||
b?.content?.reviewRating?.ratingValue
|
||||
? -1
|
||||
: 1
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user