Skip to content

Commit

Permalink
Merge pull request #50 from 31December99/0.x.x
Browse files Browse the repository at this point in the history
(Fix) various fix tmdb,contents
  • Loading branch information
31December99 authored Oct 1, 2024
2 parents 3b08002 + 851c413 commit 712da0f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion common/utility/title.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def guessit_episode_title(self):
Get the episode title
:return:
"""
return self.guessit["episode_title"] if "episode_title" in self.guessit else None
return guessit.guessit(self.filename, {"excludes": "part"}).get("episode_title", "")


@property
def type(self):
Expand Down
3 changes: 1 addition & 2 deletions media_db/tmdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ def __init__(self, table: str, content: Contents, year="", videoid=""):
self.videoid = videoid
self.tmdb = None
self._tmdb = TMDb()
#self._tmdb.language = "it-EN"
self._tmdb.language = "EN"
self._tmdb.language = "it-EN"
self._tmdb.api_key = config.TMDB_APIKEY
self.__mv_tmdb = Movie()
self.__tv_tmdb = TV()
Expand Down
10 changes: 6 additions & 4 deletions unit3dup/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def __post_init__(self):
f"{self.__class__.__name__} Set to default value {tracker_data.resolution['altro']}"
)
self.resolution = tracker_data.resolution["altro"]
# Game
self.resolution = tracker_data.resolution["altro"]


@dataclass
Expand Down Expand Up @@ -215,15 +217,15 @@ def __post_init__(self):

# Get the crew name only if the substr is at end of the string
crew_regex = (
r"\b(" + "|".join(re.escape(pattern) for pattern in crew_patterns) + r")\b$"
r"\b(" + "|".join(re.escape(pattern) for pattern in crew_patterns) + r")\b$"
)
self.crew_list = re.findall(crew_regex, self.filename_sanitized, re.IGNORECASE)

# Get the platform name
platform_regex = (
r"\b("
+ "|".join(re.escape(pattern) for pattern in platform_patterns)
+ r")\b"
r"\b("
+ "|".join(re.escape(pattern) for pattern in platform_patterns)
+ r")\b"
)
self.platform_list = re.findall(
platform_regex, self.filename_sanitized, re.IGNORECASE
Expand Down
6 changes: 4 additions & 2 deletions unit3dup/media_manager/VideoManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ def tmdb(self, content: Contents):

# if it's a season and the episode title is available
# remove the episode title from the display_name
if self._my_tmdb.episode_title:
content.display_name = content.display_name.replace(self._my_tmdb.episode_title, '')
if not content.episode_title:
if self._my_tmdb.episode_title:
content.display_name = content.display_name.replace(self._my_tmdb.episode_title, '')

return tv_show_result

def _video_info(self):
Expand Down

0 comments on commit 712da0f

Please sign in to comment.