feat: add loading of recommendations to movie page
This commit is contained in:
@@ -4,10 +4,10 @@ const moviedb = new MovieDb(Deno.env.get("TMDB_API_KEY") || "");
|
||||
|
||||
const CACHE_INTERVAL = 1000 * 60 * 24 * 30;
|
||||
|
||||
export const searchMovie = (query: string) =>
|
||||
export const searchMovie = (query: string, year?: number) =>
|
||||
cache.cacheFunction({
|
||||
fn: () => moviedb.searchMovie({ query }),
|
||||
id: `query:moviesearch:${query}`,
|
||||
fn: () => moviedb.searchMovie({ query, year }),
|
||||
id: `query:moviesearch:${query}${year ? `-${year}` : ""}`,
|
||||
options: {
|
||||
expires: CACHE_INTERVAL,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user