[videos] Fix broken install with cinemagoer
This commit is contained in:
@ -2,8 +2,6 @@ import logging
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
from cinemagoerng import web as imdb
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
YOUTUBE_VIDEO_URL = "https://www.youtube.com/watch?v="
|
||||
@ -78,39 +76,6 @@ class VideoMetadata:
|
||||
self.twitch_id = twitch_id
|
||||
self.base_run_time_seconds = base_run_time_seconds
|
||||
|
||||
def enrich_from_imdb(self):
|
||||
self.imdb_result: dict = {}
|
||||
|
||||
self.imdb_result = imdb.get_title(self.imdb_id)
|
||||
logger.debug(f"Found result from IMDB: {self.imdb_result.title}")
|
||||
|
||||
if not self.imdb_result:
|
||||
logger.info(
|
||||
f"[enrich] no video found on imdb",
|
||||
extra={"name_or_id": name_or_id},
|
||||
)
|
||||
return None
|
||||
|
||||
self.base_run_time_seconds = self.imdb_result.runtime * 60
|
||||
self.imdb_id = self.imdb_id
|
||||
self.title = self.imdb_result.title
|
||||
self.year = self.imdb_result.year
|
||||
self.plot = self.imdb_result.plot.get("en-US", "")
|
||||
self.imdb_rating = self.imdb_result.rating
|
||||
self.genres = self.imdb_result.genres
|
||||
self.cover_url = self.imdb_result.primary_image
|
||||
|
||||
self.video_type = VideoType.MOVIE.value
|
||||
if self.imdb_result.type_id == "tvEpisode":
|
||||
self.video_type = VideoType.TV_EPISODE.value
|
||||
|
||||
series = self.imdb_result.series
|
||||
self.tv_series_imdb_id = series.imdb_id
|
||||
self.tv_series_title = series.title
|
||||
self.episode_number = self.imdb_result.episode
|
||||
self.season_number = self.imdb_result.season
|
||||
self.next_imdb_id = self.imdb_result.next_episode_id
|
||||
|
||||
def as_dict_with_cover_and_genres(self) -> tuple:
|
||||
video_dict = vars(self)
|
||||
series_id = ""
|
||||
|
||||
@ -20,7 +20,6 @@ from scrobbles.mixins import (
|
||||
)
|
||||
from taggit.managers import TaggableManager
|
||||
from videos.metadata import VideoMetadata
|
||||
from videos.sources.imdb import lookup_video_from_imdb
|
||||
from videos.sources.tmdb import lookup_video_from_tmdb
|
||||
from videos.sources.youtube import lookup_video_from_youtube
|
||||
|
||||
|
||||
Reference in New Issue
Block a user