Fix missing imdb/tvdb id

This commit is contained in:
Zoe Roux 2023-09-06 19:39:16 +02:00
parent a1a5e665fb
commit 1f518c2d33
2 changed files with 8 additions and 4 deletions

View File

@ -199,7 +199,7 @@ class TheMovieDatabase(Provider):
params={
"language": lng,
"append_to_response": "alternative_titles,videos,credits,keywords,images,external_ids",
"include_image_language": f"{lng},null"
"include_image_language": f"{lng},null",
},
)
logging.debug("TMDb responded: %s", show)
@ -232,8 +232,12 @@ class TheMovieDatabase(Provider):
"imdb": MetadataID(
show["external_ids"]["imdb_id"],
f"https://www.imdb.com/title/{show['external_ids']['imdb_id']}",
),
"tvdb": MetadataID(show["external_ids"]["tvdb_id"], link=None),
)
if show["external_ids"]["imdb_id"]
else None,
"tvdb": MetadataID(show["external_ids"]["tvdb_id"], link=None)
if show["external_ids"]["tvdb_id"]
else None,
},
seasons=[
self.to_season(x, language=lng, show_id=show["id"])

View File

@ -42,7 +42,7 @@ class Show:
seasons: list[Season]
# TODO: handle staff
# staff: list[Staff]
external_id: dict[str, MetadataID]
external_id: dict[str, MetadataID | None]
translations: dict[str, ShowTranslation] = field(default_factory=dict)