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.
This commit is contained in:
@@ -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\)',
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user