diff --git a/lib/streaming_providers/base/models/vod.py b/lib/streaming_providers/base/models/vod.py index e6bcb00..39a4216 100644 --- a/lib/streaming_providers/base/models/vod.py +++ b/lib/streaming_providers/base/models/vod.py @@ -170,6 +170,11 @@ class VodItem(Content): # Promotional trailer_url: Optional[str] = None + # Content classification + # True → short highlight/clip reel (videoType == "CLIP") + # False → full broadcast recording (videoType == "STANDALONE_EVENT" etc.) + is_highlight: bool = False + # Cached slug _slug: Optional[str] = field(default=None, repr=False) @@ -205,6 +210,7 @@ class VodItem(Content): result.update({ "type": self.node_type, "slug": self.slug, + "is_highlight": self.is_highlight, "duration_seconds": self.duration_seconds, "duration_minutes": self.duration_minutes, "release_year": self.release_year, diff --git a/lib/streaming_providers/providers/discovery/vod_manager.py b/lib/streaming_providers/providers/discovery/vod_manager.py index 2e575ec..e77235a 100644 --- a/lib/streaming_providers/providers/discovery/vod_manager.py +++ b/lib/streaming_providers/providers/discovery/vod_manager.py @@ -561,6 +561,18 @@ class DiscoveryVodManager: attrs = video.get("attributes", {}) + # Only finished content is eligible for VOD. + # videoType == "LIVE" means the event is upcoming or ongoing — skip it. + # "STANDALONE_EVENT" → full past broadcast; "CLIP" → highlight reel. + video_type = attrs.get("videoType", "") + if video_type == "LIVE": + logger.debug( + f"DiscoveryVodManager: video '{video.get('id')}' is LIVE — skipping" + ) + return None + + is_highlight = video_type == "CLIP" + # Duration: edit has duration_ms; fall back to video attrs edit_obj = index.get(edit_id, {}) duration_ms = edit_obj.get("attributes", {}).get("duration") @@ -584,6 +596,7 @@ class DiscoveryVodManager: description=attrs.get("description") or attrs.get("longDescription"), logo_url=self._pick_image(video, index, "default"), duration_seconds=duration_seconds, + is_highlight=is_highlight, ) def _show_to_vod_category(