diff --git a/Blacklight/processing/tv/TVDB.php b/Blacklight/processing/tv/TVDB.php index ae6797316b..ec70542d3b 100755 --- a/Blacklight/processing/tv/TVDB.php +++ b/Blacklight/processing/tv/TVDB.php @@ -13,7 +13,6 @@ */ class TVDB extends TV { - private const TVDB_URL = 'https://api.thetvdb.com'; private const TVDB_IMAGES_URL = 'https://www.thetvdb.com/banners/'; private const TVDB_API_KEY = '31740C28BAC74DEF'; private const MATCH_PROBABILITY = 75; @@ -391,8 +390,18 @@ protected function getEpisodeInfo($tvDbId, $season, $episode, $airDate = '', $vi */ protected function formatShowInfo($show): array { - $poster = $this->client->series()->getImagesWithQuery($show->id, ['keyType' => 'poster']); - $fanart = $this->client->series()->getImagesWithQuery($show->id, ['keyType' => 'fanart']); + try { + $poster = $this->client->series()->getImagesWithQuery($show->id, ['keyType' => 'poster']); + } catch (ResourceNotFoundException $e) { + ColorCLI::doEcho(ColorCLI::notice('Poster image not found on TVDB'), true); + } + + try { + $fanart = $this->client->series()->getImagesWithQuery($show->id, ['keyType' => 'fanart']); + } catch (ResourceNotFoundException $e) { + ColorCLI::doEcho(ColorCLI::notice('Fanart image not found on TVDB'), true); + } + $imdbid = $this->client->series()->getById($show->id); preg_match('/tt(?P\d{6,7})$/i', $imdbid->imdbId, $imdb); diff --git a/Changelog b/Changelog index 16ae8c5838..d3858fe979 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-09-13 DariusIII + * Chg: Prevent errors on missing images on TVDB * Chg: Update scripts to use now() helper * Chg: Use now() helper and related functions for time calculations in ProcessReleases class * Chg: Update laravel/framework to version 5.7