Change regex for media type tags

This commit is contained in:
JonnyWong16 2016-05-06 18:41:52 -07:00
parent e50c77d8c6
commit fe2fdafbb1

View file

@ -492,13 +492,13 @@ def build_notify_text(session=None, timeline=None, notify_action=None, agent_id=
# Check for exclusion tags # Check for exclusion tags
if metadata['media_type'] == 'movie': if metadata['media_type'] == 'movie':
# Regex pattern to remove the text in the tags we don't want # Regex pattern to remove the text in the tags we don't want
pattern = re.compile(r'<tv>[^>]+.<\/tv>|<music>[^>]+.<\/music>', re.IGNORECASE | re.DOTALL) pattern = re.compile(r'<movie>|</movie>|<tv>.*</tv>|<music>.*</music>', re.IGNORECASE | re.DOTALL)
elif metadata['media_type'] == 'show' or metadata['media_type'] == 'episode': elif metadata['media_type'] == 'show' or metadata['media_type'] == 'episode':
# Regex pattern to remove the text in the tags we don't want # Regex pattern to remove the text in the tags we don't want
pattern = re.compile(r'<movie>[^>]+.<\/movie>|<music>[^>]+.<\/music>', re.IGNORECASE | re.DOTALL) pattern = re.compile(r'<movie>.*</movie>|<tv>|</tv>|<music>.*</music>', re.IGNORECASE | re.DOTALL)
elif metadata['media_type'] == 'artist' or metadata['media_type'] == 'track': elif metadata['media_type'] == 'artist' or metadata['media_type'] == 'track':
# Regex pattern to remove the text in the tags we don't want # Regex pattern to remove the text in the tags we don't want
pattern = re.compile(r'<tv>[^>]+.<\/tv>|<movie>[^>]+.<\/movie>', re.IGNORECASE | re.DOTALL) pattern = re.compile(r'<movie>.*</movie>|<tv>.*</tv>|<music>|</music>', re.IGNORECASE | re.DOTALL)
else: else:
pattern = None pattern = None