Fix episode title promotion rule when episode was already defined

This commit is contained in:
Zoe Roux 2024-04-30 19:32:52 +02:00
parent e0923807c6
commit 4c31e8cd70
No known key found for this signature in database

View File

@ -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: