From e751e82c07fa6cb2a3899d09fe60e1026f44f810 Mon Sep 17 00:00:00 2001 From: weeco <23424570+weeco@users.noreply.github.com> Date: Thu, 7 May 2026 08:29:28 -0700 Subject: [PATCH] feat(xtream): fall back to uploaded XMLTV when provider has no EPG Live TV channels in Xtream playlists go blank whenever the provider's get_short_epg returns nothing, even when the user has working XMLTV URLs in Settings. The XMLTV pipeline already populates epg_programs but only the M3U module was reading it. Wire those uploads up as a fallback for Xtream too: when the provider returns nothing for a channel with an epg_channel_id, look it up in the local table. A settings toggle flips the priority for users whose curated XMLTV is better than the provider's auto guide. EpgQueueService.enqueue() became async to batch the XMLTV lookup once per viewport change. To keep the queue consistent under fast scroll, all shared-state mutations now happen behind a generation counter so only the latest call commits. Per-method bridge gating in the new XtreamXmltvFallbackService keeps each path working when the preload exposes only one of the two endpoints. --- .../settings-epg-section.component.html | 13 + .../settings-epg-section.component.ts | 2 + .../app/settings/settings.component.spec.ts | 1 + .../src/app/settings/settings.component.ts | 3 + apps/web/src/assets/i18n/ar.json | 2 + apps/web/src/assets/i18n/ary.json | 2 + apps/web/src/assets/i18n/by.json | 2 + apps/web/src/assets/i18n/de.json | 2 + apps/web/src/assets/i18n/el.json | 2 + apps/web/src/assets/i18n/en.json | 2 + apps/web/src/assets/i18n/es.json | 2 + apps/web/src/assets/i18n/fr.json | 2 + apps/web/src/assets/i18n/it.json | 2 + apps/web/src/assets/i18n/ja.json | 2 + apps/web/src/assets/i18n/ko.json | 2 + apps/web/src/assets/i18n/nl.json | 2 + apps/web/src/assets/i18n/pl.json | 2 + apps/web/src/assets/i18n/pt.json | 2 + apps/web/src/assets/i18n/ru.json | 2 + apps/web/src/assets/i18n/tr.json | 2 + apps/web/src/assets/i18n/zh.json | 2 + apps/web/src/assets/i18n/zhtw.json | 2 + .../lib/services/epg-queue.service.spec.ts | 285 ++++++++++++++++-- .../src/lib/services/epg-queue.service.ts | 163 ++++++++-- .../data-access/src/lib/services/index.ts | 1 + .../xtream-xmltv-fallback.service.spec.ts | 195 ++++++++++++ .../services/xtream-xmltv-fallback.service.ts | 147 +++++++++ .../stores/features/with-epg.feature.spec.ts | 177 ++++++++--- .../lib/stores/features/with-epg.feature.ts | 85 +++--- .../portal-channels-list.component.ts | 16 +- .../src/lib/settings-store.service.ts | 3 + .../interfaces/src/lib/settings.interface.ts | 8 + 32 files changed, 1002 insertions(+), 133 deletions(-) create mode 100644 libs/portal/xtream/data-access/src/lib/services/xtream-xmltv-fallback.service.spec.ts create mode 100644 libs/portal/xtream/data-access/src/lib/services/xtream-xmltv-fallback.service.ts diff --git a/apps/web/src/app/settings/settings-epg-section.component.html b/apps/web/src/app/settings/settings-epg-section.component.html index 6e7f01938..dec5beaa6 100644 --- a/apps/web/src/app/settings/settings-epg-section.component.html +++ b/apps/web/src/app/settings/settings-epg-section.component.html @@ -89,6 +89,19 @@ +
+
+

{{ 'SETTINGS.PREFER_UPLOADED_EPG_TITLE' | translate }}

+

{{ 'SETTINGS.PREFER_UPLOADED_EPG_HINT' | translate }}

+
+
+ +
+
+