From 9f6a2f2eb8fd33fe1220b3e213a4df7a20ecda92 Mon Sep 17 00:00:00 2001 From: Kasper Plougmann Date: Mon, 28 Nov 2022 22:30:03 +0100 Subject: [PATCH] Enabling support for danish mpaa --- Contents/Code/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Contents/Code/__init__.py b/Contents/Code/__init__.py index c959a3d..7486441 100644 --- a/Contents/Code/__init__.py +++ b/Contents/Code/__init__.py @@ -407,9 +407,9 @@ def update(self, metadata, media, lang): # Content Rating try: mpaa = nfoXML.xpath('./mpaa')[0].text - match = re.match(r'(?:Rated\s)?(?P[A-z0-9-+/.]+(?:\s[0-9]+[A-z]?)?)?', mpaa) + match = re.match(r'(?:Rated\s)?(?P[A-z0-9-+/.:]+(?:\s[0-9]+[A-z]?)?)?', mpaa) if match.group('mpaa'): - content_rating = match.group('mpaa') + content_rating = match.group('mpaa').replace(':','/').replace('DK','dk') #Plex wants : as / and DK as dk else: content_rating = 'NR' metadata.content_rating = content_rating @@ -865,9 +865,9 @@ def UpdateEpisode(episode=episode, season_num=season_num, ep_num=ep_num, ep_key= # Ep. Content Rating try: mpaa = nfoXML.xpath('./mpaa')[0].text - match = re.match(r'(?:Rated\s)?(?P[A-z0-9-+/.]+(?:\s[0-9]+[A-z]?)?)?', mpaa) + match = re.match(r'(?:Rated\s)?(?P[A-z0-9-+/.:]+(?:\s[0-9]+[A-z]?)?)?', mpaa) if match.group('mpaa'): - content_rating = match.group('mpaa') + content_rating = match.group('mpaa').replace(':','/').replace('DK','dk') #Plex wants : as / and DK as dk else: content_rating = 'NR' episode.content_rating = content_rating