leandcesar / themoviedb

A modern and easy to use API wrapper for The Movie Database (TMDb) API v3 written in Python.
https://pypi.org/project/themoviedb
MIT License
25 stars 7 forks source link

Crash on tv details #15

Closed merlink01 closed 1 year ago

merlink01 commented 1 year ago
from themoviedb import TMDb
tmdb = TMDb(key=TMDB_API_KEY, language="de-DE",region="DE")
data = tmdb.tv(95558).details()
Traceback (most recent call last):
  File "/home/merlink/Schreibtisch/Pythondatei 2.py", line 75, in <module>
    data = tmdb.tv(95558).details()
  File "/home/merlink/.local/lib/python3.10/site-packages/themoviedb/routes_sync/tv.py", line 18, in details
    return utils.as_dataclass(schemas.TV, data)
  File "/home/merlink/.local/lib/python3.10/site-packages/themoviedb/utils.py", line 35, in as_dataclass
    return from_dict(data_class, data, config=config)
  File "/home/merlink/.local/lib/python3.10/site-packages/dacite/core.py", line 69, in from_dict
    raise WrongTypeError(field_path=field.name, field_type=field_type, value=value)
dacite.exceptions.WrongTypeError: wrong value type for field "next_episode_to_air" - should be "NoneType" instead of value "{'id': 4194489, 'name': 'Episode 8', 'overview': '', 'vote_average': 0.0, 'vote_count': 0, 'air_date': '2023-05-04', 'episode_number': 8, 'production_code': '', 'runtime': None, 'season_number': 1, 'show_id': 95558, 'still_path': '/1d0h7n3ShxgK6b9iAyD6AvnUMIB.jpg'}" of type "dict"
leandcesar commented 1 year ago

Fixed (pip install themoviedb -U), thanks for reporting!