mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 01:35:39 -04:00
Ensure enrichment data is always available on title pages
Cast, availability, recommendations, colors, and trailers were missing on first load because importTitle fire-and-forgot enrichment tasks. getTitleWithChildren now calls ensureEnriched() to backfill any missing data before rendering — works for new imports, old titles, and shells. Also removes the awaitEnrichment option from importTitle (redundant now) and optimizes DB queries: reuses already-read data for existence checks, caches fetchSeasonsFromDb result, and skips re-reads when no backfill ran. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@ export async function POST(req: NextRequest) {
|
||||
}
|
||||
|
||||
try {
|
||||
const title = await importTitle(tmdbId, type, { awaitEnrichment: true });
|
||||
const title = await importTitle(tmdbId, type);
|
||||
return NextResponse.json({ id: title?.id });
|
||||
} catch {
|
||||
return NextResponse.json(
|
||||
|
||||
Reference in New Issue
Block a user