feat: group variants of the same IPTV channel into a logical channel (#9)

Add a channelVariantGrouping service that normalizes channel names
(strips region prefixes and quality tokens) to fingerprint duplicate
stream entries and cluster them under a single logical channel with
quality/source variants. Wire it into the Live TV channel list and
player variant selection, reducing duplicates without destructively
merging streams.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
blomios
2026-10-02 08:25:42 +02:00
parent e1342348d1
commit a7a83a6faa
7 changed files with 349 additions and 131 deletions

View File

@ -36,7 +36,7 @@ class LivePage {
// Build a map for O(1) channel lookups
const channelMap = new Map();
this.app.channelList.channels.forEach(c => channelMap.set(c.id, c));
this.app.channelList.logicalChannels.forEach(c => channelMap.set(c.fingerprint, c));
// Process in small batches to avoid blocking UI
const BATCH_SIZE = 50;
@ -47,8 +47,7 @@ class LivePage {
for (let i = index; i < end; i++) {
const item = channelItems[i];
const channelId = item.dataset.channelId;
const channel = channelMap.get(channelId);
const channel = channelMap.get(item.dataset.logicalId);
if (channel) {
const programDiv = item.querySelector('.channel-program');