From 4c31e8cd7041fd61acd485f53fcbca57995af384 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 30 Apr 2024 19:32:52 +0200 Subject: [PATCH] Fix episode title promotion rule when episode was already defined --- scanner/matcher/parser/rules.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scanner/matcher/parser/rules.py b/scanner/matcher/parser/rules.py index 9632cfe6..d7a00206 100644 --- a/scanner/matcher/parser/rules.py +++ b/scanner/matcher/parser/rules.py @@ -106,6 +106,11 @@ class EpisodeTitlePromotion(Rule): if not ep_title: return + # Do not promote an episode title if there is already a know episode number + ep_nbr: List[Match] = matches.named("episode") # type: ignore + if ep_nbr and len(ep_nbr) > 0: + return + to_remove = [match for match in ep_title if str(match.value).isdecimal()] to_add = [] for tmatch in to_remove: