Pr/epg fixes#1104
Conversation
…back - Remove .limit(500) from EPG database queries (returns oldest programs, silently dropping current/recent data) - Fall back to get_short_epg endpoint when get_simple_data_table is empty (many Xtream providers don't implement the full EPG endpoint) - Don't require explicit tv_archive=1 for Xtream archive detection (providers often omit the field, making catchup unavailable)
- Replace EpgViewComponent with EpgListComponent - Add programActivated handler that constructs catchup URLs via resolveM3uCatchupUrl (M3U) or XtreamUrlService.resolveCatchupUrl - Add EPG-to-program conversion (currentPortalEpgPrograms) with proper start/stop timestamps - Add archive detection (currentPortalArchiveDays) reading tv_archive from the database (added to the favorites DB queries) - Increase portal EPG timeout from 3s to 10s (for Xtream API calls) - Try getFullEpg before getShortEpg in the favorites EPG loading path (matches the all-channels loadEpg strategy) - Enable date navigation on the live-epg-panel for all content types
- Add epg_channel_id to the favorites DB query, XtreamFavoriteRow type, and UnifiedCollectionItem interface so it flows through to the UI - Modify loadXtreamEpgItems (sidebar) and loadXtreamEpgBatch (card preview) to check the uploaded XMLTV EPG first via epg_channel_id, falling back to the Xtream API only when no match is found
… EPG paths Add right-click context menu and channel-details-dialog button for mapping EPG channels to content channels. The mapping is stored in a new epg_channel_mappings table and resolved at three levels: - epg-query.service.ts (backend query layer) — catches all getChannelPrograms calls including the Xtream XMLTV fallback - loadXtreamEpgItems (sidebar) — checks uploaded XMLTV, then mapping table, then Xtream API - loadXtreamEpgBatch (preview cards) — same three-tier fallback with concurrency limiting (max 3 simultaneous requests) Also includes EPG reliability fixes: - Reduced Xtream API failure cooldown 60s → 30s - Increased preview fetch limit 2 → 5 - Dialog now fetches current mapping on open instead of relying on callers
Greptile SummaryThis PR addresses the three previously-flagged issues: the 14-day/2-day time-window filter replaces the unbounded query,
Confidence Score: 5/5Safe to merge — all three previously-flagged regressions are corrected, the new EPG mapping feature is well-structured, and the remaining nits are minor. All previously raised issues are addressed: the unbounded query is replaced by a time-window filter, the preferUploadedEpgOverXtream setting is now respected in the favourites path, and the catchup logic has been extracted into a dedicated service. Newly introduced issues are limited to cosmetic/redundancy concerns that do not affect correctness. The 2-day forward EPG window is the only functional trade-off worth revisiting. The epg-mapping-dialog.component.ts has a duplicate this.search$ expression and an unused import to clean up. epg.events.ts and epg-query.service.ts both resolve the channel mapping for the getChannelPrograms path, producing a redundant round-trip. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[EPG Request for Channel ID] --> B{IPC boundary\nepg.events.ts}
B --> C[resolveChannelId\nDB lookup in epg_channel_mappings]
C --> D{Mapping found?}
D -- Yes --> E[Use mapped EPG Channel ID]
D -- No --> F[Use original Channel ID]
E --> G[epgQueryService.getChannelPrograms]
F --> G
G --> H[getMapping internal DB lookup\nredundant round-trip]
H --> I{Mapping found again?}
I -- Yes --> J[Use remapped ID]
I -- No --> K[Use ID as-is]
J --> L[selectChannelPrograms\nnow-14d to stop AND start to now+2d]
K --> L
L --> M[Return EpgProgram list]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[EPG Request for Channel ID] --> B{IPC boundary\nepg.events.ts}
B --> C[resolveChannelId\nDB lookup in epg_channel_mappings]
C --> D{Mapping found?}
D -- Yes --> E[Use mapped EPG Channel ID]
D -- No --> F[Use original Channel ID]
E --> G[epgQueryService.getChannelPrograms]
F --> G
G --> H[getMapping internal DB lookup\nredundant round-trip]
H --> I{Mapping found again?}
I -- Yes --> J[Use remapped ID]
I -- No --> K[Use ID as-is]
J --> L[selectChannelPrograms\nnow-14d to stop AND start to now+2d]
K --> L
L --> M[Return EpgProgram list]
Reviews (2): Last reviewed commit: "fix: add providedIn:root to catchup serv..." | Re-trigger Greptile |
38d84bf to
005d2fa
Compare
|
@greptileai Commit 005d2fa adresses your concerns, please conduct another review:
|
- remove dead this.search$ line in dialog constructor - check save/remove result before closing mapping dialog - escape LIKE wildcards (% and _) in EPG channel search - remove double mapping lookup (epg.events IPC handler no longer resolves mappings since epg-query.service already does)
I’m using IPTVNator with xstream providers and my experience left a lot to be desired so I tried to fix some of that.
I did some work on EPG and catch-up features which seemed broken in several ways, especially when browsing from the favourites tab. This PR tries to fix many problems I encountered.
While fixing stuff like not being able to load all the EPG data properly from the favourites list, not being able to activate catch-up, I also tried to fix some other things as well.
Some caveats: