Add epg_window

This commit is contained in:
Nirvana
2026-04-19 14:35:17 +02:00
parent 04f0497f14
commit 24910c524e
2 changed files with 17 additions and 0 deletions
+11
View File
@@ -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 []
+6
View File
@@ -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: