From 661d1690d252cd6fce48b202a272fd15b1d78a3e Mon Sep 17 00:00:00 2001 From: mwhit Date: Thu, 4 Jun 2026 22:28:18 +0000 Subject: [PATCH] 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. --- apps/epg/serializers.py | 14 +++++ .../src/components/ProgramDetailModal.jsx | 51 +++++++++++++++---- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/apps/epg/serializers.py b/apps/epg/serializers.py index 7da93c13..c196c4db 100644 --- a/apps/epg/serializers.py +++ b/apps/epg/serializers.py @@ -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') diff --git a/frontend/src/components/ProgramDetailModal.jsx b/frontend/src/components/ProgramDetailModal.jsx index 89388cb4..d3d9c5e5 100644 --- a/frontend/src/components/ProgramDetailModal.jsx +++ b/frontend/src/components/ProgramDetailModal.jsx @@ -298,6 +298,37 @@ export default function ProgramDetailModal({ )} + {d.content_advisory?.length > 0 && ( + + {d.content_advisory.join(', ')} + + )} + + {d.event_details && ( + <> + + + {d.event_details.venue100 && ( + + Venue: + {d.event_details.venue100} + + )} + {d.event_details.teams?.length > 0 && ( + + Teams: + {d.event_details.teams.map((t, i) => ( + + {i > 0 ? ' vs ' : ''} + {t.name}{t.isHome ? ' (Home)' : ''} + + ))} + + )} + + + )} + {hasCredits && ( <> @@ -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) && ( <> - {d.country && ( - - - Country:{' '} - - {d.country} - - )} {d.language && ( @@ -353,6 +376,14 @@ export default function ProgramDetailModal({ {d.language} )} + {d.production_date && d.is_previously_shown && ( + + + First aired:{' '} + + {d.production_date} + + )} {d.original_air_date && (