Skip to content

Commit

Permalink
Fixed year in title name
Browse files Browse the repository at this point in the history
Added:
- Use regex to remove any "(XXXX)" in a title -> EthanC#21
  • Loading branch information
TheGeeKing committed Aug 13, 2023
1 parent 87db2d6 commit abe9cd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions perplex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import re
import urllib.parse
from datetime import datetime
from pathlib import Path
Expand Down Expand Up @@ -392,6 +393,9 @@ def FetchMetadata(
settings: Dict[str, Any] = self.config["tmdb"]
key: str = settings["apiKey"]

# if title has a "(year)" in it, removes it. https://github.com/EthanC/Perplex/issues/21
title = re.sub(r"\(\d{4}\)", "", title).strip()

if settings["enable"]:

try:
Expand Down

0 comments on commit abe9cd8

Please sign in to comment.