mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
tmdb mapping fixes
This commit is contained in:
parent
a80997bef8
commit
17ec7f150c
1 changed files with 9 additions and 7 deletions
|
@ -76,10 +76,13 @@ class TMDb:
|
|||
return check_id
|
||||
|
||||
def convert_tvdb_to(self, tvdb_id):
|
||||
results = self.TMDb.find_by_id(tvdb_id=tvdb_id)
|
||||
if not results.tv_results:
|
||||
raise Failed(f"TMDb Error: No TMDb ID found for TVDb ID {tvdb_id}")
|
||||
return results.tv_results[0].id
|
||||
try:
|
||||
results = self.TMDb.find_by_id(tvdb_id=tvdb_id)
|
||||
if results.tv_results:
|
||||
return results.tv_results[0].id
|
||||
except NotFound:
|
||||
pass
|
||||
raise Failed(f"TMDb Error: No TMDb ID found for TVDb ID {tvdb_id}")
|
||||
|
||||
def convert_imdb_to(self, imdb_id):
|
||||
try:
|
||||
|
@ -91,10 +94,9 @@ class TMDb:
|
|||
elif results.tv_episode_results:
|
||||
item = results.tv_episode_results[0]
|
||||
return f"{item.tv_id}_{item.season_number}_{item.episode_number}", "episode"
|
||||
else:
|
||||
raise NotFound
|
||||
except NotFound:
|
||||
raise Failed(f"TMDb Error: No TMDb ID found for IMDb ID {imdb_id}")
|
||||
pass
|
||||
raise Failed(f"TMDb Error: No TMDb ID found for IMDb ID {imdb_id}")
|
||||
|
||||
def get_movie_show_or_collection(self, tmdb_id, is_movie):
|
||||
if is_movie:
|
||||
|
|
Loading…
Reference in a new issue