feat: remove typesense

This commit is contained in:
2025-01-05 23:14:19 +01:00
parent d0d49b217d
commit 709fb2d7be
21 changed files with 128 additions and 381 deletions

View File

@@ -6,16 +6,18 @@ import { IconArrowLeft } from "@components/icons.tsx";
import { KMenu } from "@islands/KMenu.tsx";
import { RedirectSearchHandler } from "@islands/Search.tsx";
import { parseResourceUrl, searchResource } from "@lib/search.ts";
import { SearchResult } from "@lib/types.ts";
import { GenericResource } from "@lib/types.ts";
import { PageProps } from "$fresh/server.ts";
export default async function Greet(
props: PageProps<{ movies: Movie[] | null; searchResults: SearchResult }>,
props: PageProps<
{ movies: Movie[] | null; searchResults: GenericResource[] }
>,
) {
const allMovies = await getAllMovies();
const searchParams = parseResourceUrl(props.url);
const searchResults = searchParams &&
await searchResource({ ...searchParams, type: "movie" });
await searchResource({ ...searchParams, types: ["movie"] });
const movies = allMovies.sort((a, b) =>
a?.meta?.rating > b?.meta?.rating ? -1 : 1
);