mirror of
https://github.com/nirvana-7777/script.service.ultimate.git
synced 2026-10-11 18:32:32 +02:00
Add epg_window
This commit is contained in:
@@ -195,6 +195,17 @@ class StreamingProvider(ABC):
|
||||
"""Return True if provider uses truly dynamic manifests"""
|
||||
return False
|
||||
|
||||
@property
|
||||
def epg_window(self) -> Tuple[int, int]:
|
||||
"""
|
||||
Return the EPG window as (past_days, future_days).
|
||||
|
||||
Returns:
|
||||
Tuple[int, int]: Number of days of EPG available in the past and future.
|
||||
(0, 0) means this provider does not implement EPG.
|
||||
"""
|
||||
return 0, 0
|
||||
|
||||
def get_channels(self, **kwargs) -> List[StreamingChannel]:
|
||||
"""Fetch channels from the provider"""
|
||||
return []
|
||||
|
||||
@@ -107,6 +107,7 @@ def setup_provider_routes(app, manager, service):
|
||||
provider_catchup_hours = getattr(
|
||||
provider_instance, "catchup_window", 0
|
||||
) # CHANGE
|
||||
epg_window = getattr(provider_instance, "epg_window", (0, 0))
|
||||
|
||||
# Build channel list with catchup info
|
||||
channels_data = []
|
||||
@@ -125,6 +126,11 @@ def setup_provider_routes(app, manager, service):
|
||||
"provider": provider,
|
||||
"country": provider_instance.country if provider_instance else "DE",
|
||||
"catchup_window_hours": provider_catchup_hours, # CHANGE
|
||||
"epg_window": {
|
||||
"past_days": epg_window[0],
|
||||
"future_days": epg_window[1],
|
||||
"implements_epg": epg_window != (0, 0),
|
||||
},
|
||||
"channels": channels_data,
|
||||
}
|
||||
except Exception as api_err:
|
||||
|
||||
Reference in New Issue
Block a user