Skip to content

Commit

Permalink
Regex update for improved Windows compatibility.
Browse files Browse the repository at this point in the history
Changed instances of re.sub to use a raw interpretation to avoid possible 'invalid escape sequence' errors on Windows clients.
  • Loading branch information
InsertDisc authored May 3, 2024
1 parent 9cba575 commit d0277d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pattrmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def __init__(self, ratingKey, title, added, released, size):
class itemBase:
def __init__(self, title, date, details):
self.title = re.sub("\s\(.*?\)","", title)
self.title = re.sub(r"\s\(.*?\)","", title)
self.date = datetime.datetime.strptime(date, '%Y-%m-%d').date()
self.details = details
Expand Down Expand Up @@ -809,7 +809,7 @@ def get_show_name(self, rating_key):
values = data['MediaContainer']['Metadata']
for result in values:
title = result['title']
title = re.sub("\s\(.*?\)","", title)
title = re.sub(r"\s\(.*?\)","", title)
return title
else:
return f"Error: {response.status_code} - {response.text}"
Expand Down Expand Up @@ -1939,7 +1939,7 @@ def get_year(date):
# strip (words) and url format plex title #
class PlexItem:
def __init__(self, title, year, ratingKey):
self.title = re.sub("\s\(.*?\)","", title)
self.title = re.sub(r"\s\(.*?\)","", title)
if year != "null":
self.year = datetime.strptime(year, '%Y-%m-%d').year
else:
Expand Down

0 comments on commit d0277d6

Please sign in to comment.