From b0ccb01b02b6dceec0fcaba597f08e18d46b072d Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sat, 19 Oct 2019 21:56:48 +0200 Subject: [PATCH] Update TVDB class poster and fanart image retrieval --- Blacklight/processing/tv/TVDB.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Blacklight/processing/tv/TVDB.php b/Blacklight/processing/tv/TVDB.php index af46947c5..5eb4926a2 100755 --- a/Blacklight/processing/tv/TVDB.php +++ b/Blacklight/processing/tv/TVDB.php @@ -148,14 +148,6 @@ class TVDB extends TV } if ((int) $videoId > 0 && (int) $tvDbId > 0) { - // Now that we have valid video and tvdb ids, try to get the poster - if (! empty($tvdbShow['poster'])) { - $this->posterUrl = self::TVDB_IMAGES_URL.'/'.$tvdbShow['poster']; - } - - if (! empty($tvdbShow['fanart'])) { - $this->fanartUrl = self::TVDB_IMAGES_URL.'/'.$tvdbShow['fanart']; - } if (! empty($tvdbShow['poster']) || ! empty($tvdbShow['fanart'])) { $this->getPoster($videoId); @@ -390,12 +382,14 @@ class TVDB extends TV { try { $poster = $this->client->series()->getImagesWithQuery($show->id, ['keyType' => 'poster']); + $this->posterUrl = $poster[0]->thumbnail ?? ''; } catch (ResourceNotFoundException $e) { $this->colorCli->notice('Poster image not found on TVDB', true); } try { $fanart = $this->client->series()->getImagesWithQuery($show->id, ['keyType' => 'fanart']); + $this->fanartUrl = $fanart[0]->thumbnail ?? ''; } catch (ResourceNotFoundException $e) { $this->colorCli->notice('Fanart image not found on TVDB', true); }