From 24910c524eb8fc06119ba1ff52e0374a34999320 Mon Sep 17 00:00:00 2001 From: Nirvana Date: Sun, 19 Apr 2026 14:35:17 +0200 Subject: [PATCH] Add epg_window --- lib/streaming_providers/base/provider.py | 11 +++++++++++ routes/providers.py | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/lib/streaming_providers/base/provider.py b/lib/streaming_providers/base/provider.py index 0873653..69e5027 100644 --- a/lib/streaming_providers/base/provider.py +++ b/lib/streaming_providers/base/provider.py @@ -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 [] diff --git a/routes/providers.py b/routes/providers.py index a677a5a..7037f77 100644 --- a/routes/providers.py +++ b/routes/providers.py @@ -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: