mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 02:45:39 -04:00
- Add `resolveTitle` and `resolvePerson` server actions that import
from TMDB and return the internal DB id
- Remove `tmdb-{id}-{type}` URL pattern and server-side redirect logic
from TitleDetailPage and PersonDetailPage
- Rename `importTitle` → `getOrFetchTitleByTmdbId`; add `getOrFetchTitle`
combining fetch + children lookup
- Update HeroBanner, TitleCard, and CommandPalette to call resolve
actions client-side before pushing to router
- Batch availability offer inserts into a single transaction
11 lines
327 B
TypeScript
11 lines
327 B
TypeScript
"use server";
|
|
|
|
import { requireSession } from "@/lib/auth/session";
|
|
import { getOrFetchPersonByTmdbId } from "@/lib/services/person";
|
|
|
|
export async function resolvePerson(tmdbId: number): Promise<string | null> {
|
|
await requireSession();
|
|
const person = await getOrFetchPersonByTmdbId(tmdbId);
|
|
return person?.id ?? null;
|
|
}
|