[videos] IMDB blew us up again, switch to TMdb
This commit is contained in:
@ -195,7 +195,7 @@ class Series(TimeStampedModel):
|
||||
name_or_id = self.name
|
||||
if self.imdb_id:
|
||||
name_or_id = self.imdb_id
|
||||
video_metadata: VideoMetadata = lookup_video_from_imdb(name_or_id)
|
||||
video_metadata: VideoMetadata = lookup_video_from_tmdb(name_or_id)
|
||||
|
||||
if not video_metadata.title:
|
||||
logger.warning(f"No imdb data for {self}")
|
||||
@ -220,7 +220,7 @@ class Series(TimeStampedModel):
|
||||
logger.info("Series not created and overwrite=False, returning")
|
||||
return series
|
||||
|
||||
vdict, _, cover, genres = lookup_video_from_imdb(
|
||||
vdict, _, cover, genres = lookup_video_from_tmdb(
|
||||
imdb_id
|
||||
).as_dict_with_cover_and_genres()
|
||||
vdict.pop("video_type")
|
||||
@ -392,7 +392,7 @@ class Video(ScrobblableMixin):
|
||||
if not created and not overwrite:
|
||||
return video
|
||||
|
||||
vdict, series_id, cover, genres = lookup_video_from_imdb(
|
||||
vdict, series_id, cover, genres = lookup_video_from_tmdb(
|
||||
imdb_id
|
||||
).as_dict_with_cover_and_genres()
|
||||
|
||||
|
||||
@ -24,12 +24,9 @@ def lookup_video_from_tmdb(
|
||||
from videos.models import Series
|
||||
|
||||
imdb_id = name_or_id
|
||||
if name_or_id.startswith("tt"):
|
||||
imdb_id = name_or_id[2:]
|
||||
|
||||
video_metadata = VideoMetadata(imdb_id=imdb_id)
|
||||
|
||||
tmdb_result = tmdb.find().by_imdb("tt" + imdb_id)
|
||||
tmdb_result = tmdb.find().by_imdb(imdb_id)
|
||||
|
||||
if not tmdb_result:
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user