feat: replace tv show icon

This commit is contained in:
2023-08-09 13:32:28 +02:00
parent fb96e9f71a
commit 95525406d1
11 changed files with 36 additions and 37 deletions

View File

@ -23,7 +23,7 @@ type ImageParams = {
const log = createLogger("api/image");
async function getRemoteImage(image: string) {
log.debug("[api/image] fetching", { image });
log.debug("fetching", { image });
const sourceRes = await fetch(image);
if (!sourceRes.ok) {
return "Error retrieving image from URL.";
@ -68,6 +68,10 @@ function modifyImage(
format = MagickFormat.Webp;
}
if (params.mediaType === "image/png") {
format = MagickFormat.Png;
}
ImageMagick.read(imageBuffer, format, (image) => {
const sizingData = getWidthHeight(image, params);
if (params.mode === "resize") {

View File

@ -22,6 +22,11 @@ export const handler: Handlers = {
filter_by.push(`type:=${type}`);
}
const status = url.searchParams.get("status");
if (status) {
filter_by.push(`status:=${status}`);
}
const hashTags = extractHashTags(query);
if (hashTags?.length) {
filter_by.push(`tags:[${hashTags.map((t) => `\`${t}\``).join(",")}]`);

View File

@ -9,8 +9,8 @@ import { KMenu } from "@islands/KMenu.tsx";
export const handler: Handlers<Series | null> = {
async GET(_, ctx) {
const movie = await getSeries(ctx.params.name);
return ctx.render(movie);
const series = await getSeries(ctx.params.name);
return ctx.render(series);
},
};

View File

@ -3,10 +3,9 @@ import { MainLayout } from "@components/layouts/main.tsx";
import { Grid } from "@components/Grid.tsx";
import { IconArrowLeft } from "@components/icons.tsx";
import { getAllSeries, Series } from "@lib/resource/series.ts";
import { Card } from "@components/Card.tsx";
import { RedirectSearchHandler } from "@islands/Search.tsx";
import { KMenu } from "@islands/KMenu.tsx";
import { SeriesCard } from "@components/MovieCard.tsx";
import { MovieCard } from "@components/MovieCard.tsx";
export const handler: Handlers<Series[] | null> = {
async GET(_, ctx) {
@ -33,7 +32,7 @@ export default function Greet(props: PageProps<Series[] | null>) {
</header>
<Grid>
{props.data?.map((doc) => {
return <SeriesCard series={doc} />;
return <MovieCard sublink="series" movie={doc} />;
})}
</Grid>
</MainLayout>