diff --git a/app/show/movie/[id]/page.tsx b/app/show/movie/[id]/page.tsx index 458ce73..f674e48 100644 --- a/app/show/movie/[id]/page.tsx +++ b/app/show/movie/[id]/page.tsx @@ -33,6 +33,7 @@ import { Suspense } from "react"; interface Params { params: { id: string }; } + interface Authentication { success: boolean; status_code: number; @@ -72,9 +73,12 @@ export async function generateMetadata({ params }: Params): Promise { } export default async function Page({ params }: Params) { - const { movie, status } = await getMovie(params.id); - const states = await getStates(params.id); - const isAuthenticated = await authenticateUser(); + const [movieData, states, isAuthenticated] = await Promise.all([ + getMovie(params.id), + getStates(params.id), + authenticateUser(), + ]); + const { movie, status } = movieData; if (status === "error") { return notFound(); @@ -205,9 +209,7 @@ export default async function Page({ params }: Params) { ); } -async function getMovie( - movieId: string -): Promise<{ +async function getMovie(movieId: string): Promise<{ movie: MovieResponse | null; status: Status; error: string | null; diff --git a/app/show/tv/[id]/page.tsx b/app/show/tv/[id]/page.tsx index f15fd04..7602d3a 100644 --- a/app/show/tv/[id]/page.tsx +++ b/app/show/tv/[id]/page.tsx @@ -67,13 +67,16 @@ export async function generateMetadata({ params }: Params): Promise { } export default async function Page({ params }: Params) { - const { tv, status } = await getTvShow(params.id); - const states = await getStates(params.id); - const isAuthenticated = await authenticateUser(); + const [tvData, states, isAuthenticated] = await Promise.all([ + getTvShow(params.id), + getStates(params.id), + authenticateUser(), + ]); + const { tv, status } = tvData; - if (status === "pending") { - return
loading...
; - } + // if (status === "pending") { + // return
loading...
; + // } if (status === "error") { return notFound(); } diff --git a/app/watchlist/movie/page.tsx b/app/watchlist/movie/page.tsx index 93a50ec..209c7a8 100644 --- a/app/watchlist/movie/page.tsx +++ b/app/watchlist/movie/page.tsx @@ -55,15 +55,14 @@ export default async function Page({ return (
- {movies?.results.length && - movies.results.map((movie, index) => ( - - media={movie} - title={movie.title} - key={index} - className="lg:col-span-1 md:col-span-2 col-span-3" - /> - ))} + {movies.results.map((movie, index) => ( + + media={movie} + title={movie.title} + key={index} + className="lg:col-span-1 md:col-span-2 col-span-3" + /> + ))}
diff --git a/app/watchlist/tv/page.tsx b/app/watchlist/tv/page.tsx index a5022dd..053e829 100644 --- a/app/watchlist/tv/page.tsx +++ b/app/watchlist/tv/page.tsx @@ -34,9 +34,6 @@ export default async function Page({ const account = await getAccount(); const tv = await getWatchlistTv(account.id, currentPage as string); - // const { isAuthenticated } = useAccountStore() - // const { data: tv } = useFetch>(`/account/9578292/watchlist/tv`) - if (!isAuthenticated) { return (
diff --git a/next.config.mjs b/next.config.mjs index 77d68e9..74ab0a2 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,15 @@ /** @type {import('next').NextConfig} */ const nextConfig = { output: "standalone", + images: { + remotePatterns: [ + { + protocol: "https", + hostname: "image.tmdb.org", + port: "", + }, + ], + }, }; export default nextConfig; diff --git a/src/components/BackdropCard.tsx b/src/components/BackdropCard.tsx index 6bb53f9..078b86c 100644 --- a/src/components/BackdropCard.tsx +++ b/src/components/BackdropCard.tsx @@ -1,8 +1,8 @@ "use client"; import Link from "next/link"; import type { ComponentPropsWithRef } from "react"; -import RImage from "./RImage"; import imageUrl from "@/utils/image-url"; +import Image from "next/image"; export interface SimpleBaseMedia { adult: boolean; @@ -36,13 +36,14 @@ export default function BackdropCard({ className={`${props.className} rounded-md group overflow-clip`} > -
diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index a5576ac..4cf23a1 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,4 +1,5 @@ import Link from "next/link"; +import Image from "next/image"; export default function Footer() { return ( @@ -11,10 +12,10 @@ export default function Footer() { design. Users can browse various movie titles and access detailed information, including the synopsis and trailers.

-
+

Data provided by

- + Tmbdb Logo

© 2024