[38] account for tmdb items that dont exist

pull/858/head
meisnate12 3 years ago
parent 257c3a9ba9
commit 05367f9be2

@ -1 +1 @@
1.16.5-develop37 1.16.5-develop38

@ -266,18 +266,21 @@ class Overlays:
return key_to_overlays, properties return key_to_overlays, properties
def find_poster_url(self, item): def find_poster_url(self, item):
if isinstance(item, Movie): try:
if item.ratingKey in self.library.movie_rating_key_map: if isinstance(item, Movie):
return self.config.TMDb.get_movie(self.library.movie_rating_key_map[item.ratingKey]).poster_url if item.ratingKey in self.library.movie_rating_key_map:
elif isinstance(item, (Show, Season, Episode)): return self.config.TMDb.get_movie(self.library.movie_rating_key_map[item.ratingKey]).poster_url
check_key = item.ratingKey if isinstance(item, Show) else item.show().ratingKey elif isinstance(item, (Show, Season, Episode)):
tmdb_id = self.config.Convert.tvdb_to_tmdb(self.library.show_rating_key_map[check_key]) check_key = item.ratingKey if isinstance(item, Show) else item.show().ratingKey
if isinstance(item, Show) and item.ratingKey in self.library.show_rating_key_map: tmdb_id = self.config.Convert.tvdb_to_tmdb(self.library.show_rating_key_map[check_key])
return self.config.TMDb.get_show(tmdb_id).poster_url if isinstance(item, Show) and item.ratingKey in self.library.show_rating_key_map:
elif isinstance(item, Season): return self.config.TMDb.get_show(tmdb_id).poster_url
return self.config.TMDb.get_season(tmdb_id, item.seasonNumber).poster_url elif isinstance(item, Season):
elif isinstance(item, Episode): return self.config.TMDb.get_season(tmdb_id, item.seasonNumber).poster_url
return self.config.TMDb.get_episode(tmdb_id, item.seasonNumber, item.episodeNumber).still_url elif isinstance(item, Episode):
return self.config.TMDb.get_episode(tmdb_id, item.seasonNumber, item.episodeNumber).still_url
except Failed as e:
logger.error(e)
def get_overlay_items(self, label="Overlay", libtype=None, ignore=None): def get_overlay_items(self, label="Overlay", libtype=None, ignore=None):
items = self.library.search(label=label, libtype=libtype) items = self.library.search(label=label, libtype=libtype)

Loading…
Cancel
Save