mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 00:25:38 -04:00
Integrate TMDB credits data into the app: cast carousels on title detail pages, person detail pages with biography and filmography, and person search results in the command palette. Includes new persons/titleCast DB tables, profile image caching, and a nightly credits refresh cron job. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
615 B
TypeScript
20 lines
615 B
TypeScript
import { headers } from "next/headers";
|
|
import { type NextRequest, NextResponse } from "next/server";
|
|
import { auth } from "@/lib/auth/server";
|
|
import { fetchFullFilmography } from "@/lib/services/person";
|
|
|
|
export async function GET(
|
|
_req: NextRequest,
|
|
{ params }: { params: Promise<{ id: string }> },
|
|
) {
|
|
const session = await auth.api.getSession({ headers: await headers() });
|
|
if (!session) {
|
|
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
}
|
|
|
|
const { id } = await params;
|
|
const filmography = await fetchFullFilmography(id);
|
|
|
|
return NextResponse.json({ filmography });
|
|
}
|