From 0c0b045e68347903d0b8c37e6343071c29ea526f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 6 Nov 2025 18:01:16 +0000 Subject: [PATCH] Add FHD and UHD support to stream quality matching Fix bug where FHD and UHD streams were not being matched to channels. The HARDCODED_IGNORE_PATTERNS were missing FHD and UHD in several regex patterns, causing streams like "BBC one FHD" to fail normalization and be excluded from matching results. Changes: - Add FHD and UHD to bracketed quality patterns: [FHD], [UHD], [fhd], [uhd] - Add FHD and UHD to unbracketed quality patterns at end: " FHD", " UHD" - Add FHD and UHD to parentheses patterns: (FHD), (UHD) - Add FHD and UHD to word boundary patterns: "FHD:", "UHD:" - Add UHD to STREAM_QUALITY_ORDER for proper quality sorting - Add UHD to CHANNEL_QUALITY_TAG_ORDER for channel prioritization This ensures streams with FHD/UHD quality tags are properly normalized and matched alongside HD and SD streams. Fixes issue where only HD and SD streams were matched while FHD streams were ignored. --- Stream-Mapparr/fuzzy_matcher.py | 12 ++++++------ Stream-Mapparr/plugin.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Stream-Mapparr/fuzzy_matcher.py b/Stream-Mapparr/fuzzy_matcher.py index b288aff..44b3b22 100644 --- a/Stream-Mapparr/fuzzy_matcher.py +++ b/Stream-Mapparr/fuzzy_matcher.py @@ -15,15 +15,15 @@ LOGGER = logging.getLogger("plugins.fuzzy_matcher") # Hardcoded regex patterns to ignore during fuzzy matching HARDCODED_IGNORE_PATTERNS = [ - r'\[(4K|FHD|HD|SD|Unknown|Unk|Slow|Dead)\]', - r'\[(?:4k|fhd|hd|sd|unknown|unk|slow|dead)\]', + r'\[(4K|UHD|FHD|HD|SD|Unknown|Unk|Slow|Dead)\]', + r'\[(?:4k|uhd|fhd|hd|sd|unknown|unk|slow|dead)\]', r'\([A-Z]\)', r'\s[Ee][Aa][Ss][Tt]', - r'\s(?:SD|HD|FD)\s', - r'\s(?:SD|HD|FD)$', - r'\b(?:SD|HD|FD|FHD):?\s', + r'\s(?:UHD|FHD|SD|HD|FD)\s', + r'\s(?:UHD|FHD|SD|HD|FD)$', + r'\b(?:UHD|FHD|SD|HD|FD):?\s', r'\s\(CX\)', - r'\s\((SD|HD|FD|Backup)\)', + r'\s\((UHD|FHD|SD|HD|FD|Backup)\)', r'\bUSA?:\s', r'\bUS\s', r'\([bB]ackup\)', diff --git a/Stream-Mapparr/plugin.py b/Stream-Mapparr/plugin.py index 543006e..c43482a 100644 --- a/Stream-Mapparr/plugin.py +++ b/Stream-Mapparr/plugin.py @@ -149,11 +149,11 @@ class Plugin: ] # Quality precedence order for channel tags - CHANNEL_QUALITY_TAG_ORDER = ["[4K]", "[FHD]", "[HD]", "[SD]", "[Unknown]", "[Slow]", ""] + CHANNEL_QUALITY_TAG_ORDER = ["[4K]", "[UHD]", "[FHD]", "[HD]", "[SD]", "[Unknown]", "[Slow]", ""] # Quality precedence order for stream tags (brackets and parentheses) STREAM_QUALITY_ORDER = [ - "[4K]", "(4K)", "4K", + "[4K]", "(4K)", "4K", "[UHD]", "(UHD)", "UHD", "[FHD]", "(FHD)", "FHD", "[HD]", "(HD)", "HD", "(H)", "[SD]", "(SD)", "SD",