mirror of
https://github.com/nirvana-7777/script.service.ultimate.git
synced 2026-10-11 02:12:31 +02:00
Add discovery
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user