feat: store image metadata in sqlite and images on disk

This commit is contained in:
2025-01-05 21:27:31 +01:00
parent bf7d88a588
commit 20a2781214
18 changed files with 641 additions and 379 deletions

View File

@@ -1,7 +1,7 @@
import { isLocalImage, isYoutubeLink } from "@lib/string.ts";
import { isYoutubeLink } from "@lib/string.ts";
import { IconBrandYoutube } from "@components/icons.tsx";
import { GenericResource } from "@lib/types.ts";
import { Rating, SmallRating } from "@components/Rating.tsx";
import { SmallRating } from "@components/Rating.tsx";
export function Card(
{
@@ -95,11 +95,11 @@ export function Card(
export function ResourceCard(
{ res, sublink = "movies" }: { sublink?: string; res: GenericResource },
) {
const { meta: { image = "/placeholder.svg" } = {} } = res;
const { meta: { image } = {} } = res;
const imageUrl = isLocalImage(image)
const imageUrl = image
? `/api/images?image=${image}&width=200&height=200`
: image;
: "/placeholder.svg";
return (
<Card