feat: expose SD enrichment fields in serializer and frontend

Add content_advisory, content_ratings, event_details, runtime to
ProgramDetailSerializer. Display content advisory, sports venue/teams,
and first-aired date in ProgramDetailModal.
This commit is contained in:
mwhit 2026-06-04 22:28:18 +00:00
parent ac3a83a1aa
commit 661d1690d2
2 changed files with 55 additions and 10 deletions

View file

@ -146,6 +146,20 @@ class ProgramDetailSerializer(ProgramDataSerializer):
previously_shown = cp.get('previously_shown_details') or {}
data['original_air_date'] = previously_shown.get('start')
# Content advisory (SD)
data['content_advisory'] = cp.get('content_advisory') or []
# Full content ratings array (SD — all regional ratings)
data['content_ratings'] = cp.get('content_ratings') or []
# Sports event details (SD)
data['event_details'] = cp.get('event_details')
# Runtime (duration without commercials)
length = cp.get('length') or {}
data['runtime'] = length.get('value') if length else None
data['runtime_units'] = length.get('units') if length else None
# External IDs
data['imdb_id'] = cp.get('imdb.com_id')
data['tmdb_id'] = cp.get('themoviedb.org_id')

View file

@ -298,6 +298,37 @@ export default function ProgramDetailModal({
</>
)}
{d.content_advisory?.length > 0 && (
<Text size="xs" c="orange" fs="italic">
{d.content_advisory.join(', ')}
</Text>
)}
{d.event_details && (
<>
<Divider color="#333" />
<Stack gap={4}>
{d.event_details.venue100 && (
<Text size="sm" c="dimmed">
<Text span fw={600}>Venue: </Text>
{d.event_details.venue100}
</Text>
)}
{d.event_details.teams?.length > 0 && (
<Text size="sm" c="dimmed">
<Text span fw={600}>Teams: </Text>
{d.event_details.teams.map((t, i) => (
<Text span key={i}>
{i > 0 ? ' vs ' : ''}
{t.name}{t.isHome ? ' (Home)' : ''}
</Text>
))}
</Text>
)}
</Stack>
</>
)}
{hasCredits && (
<>
<Divider color="#333" />
@ -330,21 +361,13 @@ export default function ProgramDetailModal({
</>
)}
{(d.country ||
d.language ||
{(d.language ||
d.original_air_date ||
(d.production_date && d.is_previously_shown) ||
starRatings.length > 0) && (
<>
<Divider color="#333" />
<Group gap="md" wrap="wrap">
{d.country && (
<Text size="sm" c="dimmed">
<Text span fw={600}>
Country:{' '}
</Text>
{d.country}
</Text>
)}
{d.language && (
<Text size="sm" c="dimmed">
<Text span fw={600}>
@ -353,6 +376,14 @@ export default function ProgramDetailModal({
{d.language}
</Text>
)}
{d.production_date && d.is_previously_shown && (
<Text size="sm" c="dimmed">
<Text span fw={600}>
First aired:{' '}
</Text>
{d.production_date}
</Text>
)}
{d.original_air_date && (
<Text size="sm" c="dimmed">
<Text span fw={600}>