mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 01:35:39 -04:00
- Delete filterable-row, backup-schedule, integrations, and system-health atom files; replace with useState/useTransition + server action calls - Replace /api/explore/discover route with discoverByGenre server action; refactor FilterableTitleRow to call it directly via useTransition - Wrap PagesLayout and AuthLayout children in Suspense to fix dynamic rendering errors during PPR static generation; remove StoreProvider - Sequence ExplorePage session fetch before TMDB calls to prevent build-time requests during static generation - Drop unnecessary "use client" directives from dashboard and person components that have no client-side hooks or browser API usage - Improve Dockerfile: add bun install layer cache mount, copy .next/cache from builder, reorder ENV declarations
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import { redirect } from "next/navigation";
|
|
import { Suspense } from "react";
|
|
import { LandingPage } from "@/components/landing-page";
|
|
import { getSession } from "@/lib/auth/session";
|
|
import { isTmdbConfigured } from "@/lib/config";
|
|
import { getUserCount, isRegistrationOpen } from "@/lib/services/settings";
|
|
import { tmdbImageUrl } from "@/lib/tmdb/image";
|
|
|
|
// Well-known TMDB poster paths for the background collage
|
|
const posterPaths = [
|
|
"/qJ2tW6WMUDux911r6m7haRef0WH.jpg", // The Dark Knight
|
|
"/gEU2QniE6E77NI6lCU6MxlNBvIx.jpg", // Interstellar
|
|
"/rCzpDGLbOoPwLjy3OAm5NUPOTrC.jpg", // The Lord of the Rings
|
|
"/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg", // Fight Club
|
|
"/d5NXSklXo0qyIYkgV94XAgMIckC.jpg", // Dune
|
|
"/ztkUQFLlC19CCMYHW9o1zWhJRNq.jpg", // Breaking Bad
|
|
"/7DJKHzAi83BmQrWLrYYOqcoKfhR.jpg", // The Office
|
|
"/u3bZgnGQ9T01sWNhyveQz0wH0Hl.jpg", // Stranger Things
|
|
"/ggFHVNu6YYI5L9pCfOacjizRGt.jpg", // Back to the Future
|
|
"/q6y0Go1tsGEsmtFryDOJo3dEmqu.jpg", // The Shawshank Redemption
|
|
"/pIkRyD18kl4FhoCNQuWxWu5cBLM.jpg", // Inception
|
|
"/saHP97rTPS5eLmrLQEcANmKrsFl.jpg", // Forrest Gump
|
|
];
|
|
|
|
const posterUrls = posterPaths
|
|
.map((p) => tmdbImageUrl(p, "w300"))
|
|
.filter(Boolean) as string[];
|
|
|
|
export default function Home() {
|
|
return (
|
|
<Suspense>
|
|
<HomeContent />
|
|
</Suspense>
|
|
);
|
|
}
|
|
|
|
async function HomeContent() {
|
|
const session = await getSession();
|
|
if (session?.user) redirect("/dashboard");
|
|
if (!isTmdbConfigured()) redirect("/setup");
|
|
|
|
const userCount = getUserCount();
|
|
return (
|
|
<LandingPage
|
|
posterUrls={posterUrls}
|
|
freshInstall={userCount === 0}
|
|
registrationOpen={isRegistrationOpen()}
|
|
/>
|
|
);
|
|
}
|