diff --git a/islands/Search.tsx b/islands/Search.tsx index b8fec47..fc3c540 100644 --- a/islands/Search.tsx +++ b/islands/Search.tsx @@ -190,7 +190,7 @@ const Search = ( onInput={handleInputChange} /> - +
diff --git a/lib/recommendation.ts b/lib/recommendation.ts index cc1987b..ece882a 100644 --- a/lib/recommendation.ts +++ b/lib/recommendation.ts @@ -74,7 +74,7 @@ export function getRecommendation( } export async function getSimilarMovies(id: string) { - const recs = getRecommendation(id, "movie"); + const recs = getRecommendation(id, "movies"); if (!recs?.keywords?.length) return; const recommendations = await openai.getMovieRecommendations( diff --git a/lib/search.ts b/lib/search.ts index 5a84ab8..eb1a091 100644 --- a/lib/search.ts +++ b/lib/search.ts @@ -60,7 +60,7 @@ export async function searchResource( (!types || types.includes("recipes")) && listResources("recipes"), ])).flat().filter(isResource); - console.log({ types, rating, tags, q }); + console.log({ types, rating, tags, q, resourceLength: resources.length }); const results: Record = {}; @@ -104,6 +104,7 @@ export async function searchResource( ], threshold: 0.3, }); + console.log({ fuzzyResult }); for (const result of fuzzyResult) { results[result.obj.name] = result.obj; } diff --git a/routes/admin/cache/index.tsx b/routes/admin/cache/index.tsx index 7682d4f..eefcae3 100644 --- a/routes/admin/cache/index.tsx +++ b/routes/admin/cache/index.tsx @@ -20,7 +20,7 @@ export default function Greet(
diff --git a/routes/api/tmdb/query.ts b/routes/api/tmdb/query.ts
index 9d9a122..6a6367e 100644
--- a/routes/api/tmdb/query.ts
+++ b/routes/api/tmdb/query.ts
@@ -19,9 +19,9 @@ const GET = async (
     throw new BadRequestError();
   }
 
-  const type = u.searchParams.get("type") || "movie";
+  const type = u.searchParams.get("type") || "movies";
 
-  const res = type === "movie"
+  const res = type === "movies"
     ? await searchMovie(query)
     : await searchTVShow(query);
 
diff --git a/routes/articles/[name].tsx b/routes/articles/[name].tsx
index 9a4a76c..60a0899 100644
--- a/routes/articles/[name].tsx
+++ b/routes/articles/[name].tsx
@@ -50,7 +50,7 @@ export default function Greet(
       context={article}
     >
       
-      
+      
       
 
       ("articles");
     const searchParams = parseResourceUrl(req.url);
     const searchResults = searchParams &&
-      await searchResource({ ...searchParams, types: ["article"] });
+      await searchResource({ ...searchParams, types: ["articles"] });
     return ctx.render({ articles, searchResults });
   },
 };
@@ -32,7 +32,7 @@ export default function Greet(
     
       
@@ -47,7 +47,7 @@ export default function Greet(

📝 Articles

- + {articles?.map((doc) => ( )}
diff --git a/routes/movies/index.tsx b/routes/movies/index.tsx index f472a89..3394daa 100644 --- a/routes/movies/index.tsx +++ b/routes/movies/index.tsx @@ -22,7 +22,7 @@ export default async function MovieIndex( const allMovies = await listResources("movies"); const searchParams = parseResourceUrl(props.url); const searchResults = searchParams && - await searchResource({ ...searchParams, types: ["movie"] }); + await searchResource({ ...searchParams, types: ["movies"] }); const movies = allMovies.sort((a, b) => sortOptional( a.content.reviewRating?.ratingValue, @@ -34,11 +34,11 @@ export default async function MovieIndex( - +
("recipes"); const searchParams = parseResourceUrl(req.url); const searchResults = searchParams && - await searchResource({ ...searchParams, types: ["recipe"] }); + await searchResource({ ...searchParams, types: ["recipes"] }); return ctx.render({ recipes, searchResults }); }, }; @@ -32,10 +32,10 @@ export default function Greet( url={props.url} title="Recipes" searchResults={searchResults} - context={{ type: "recipe" }} + context={{ type: "recipes" }} > - +