No need to check if traktid is set, as if there is info id is always set. Return false if cover or banner are not set for trakt.

This commit is contained in:
DariusIII
2015-09-02 21:58:15 +02:00
parent c07e05c06b
commit d6b7ec1685
+7 -3
View File
@@ -663,7 +663,7 @@ class Movie
$mov['imdbid'] = $imdbId;
$mov['tmdbid'] = (!isset($tmdb['tmdbid']) || $tmdb['tmdbid'] == '') ? 0 : $tmdb['tmdbid'];
$mov['traktid'] = (!isset($trakt['id']) || $trakt['id'] == '') ? 0 : $trakt['id'];
$mov['traktid'] = $trakt['id'];
// Prefer Fanart.tv cover over TRAKT, TRAKT over TMDB and TMDB over IMDB.
if ($this->checkVariable($fanart['cover'])) {
@@ -994,11 +994,15 @@ class Movie
$resp = $this->traktTv->movieSummary('tt' . $imdbId, 'full,images');
if ($resp !== false) {
$ret = [];
if (isset($resp['images']['poster']['thumb'])) {
if (isset($resp['images']['poster']['thumb']) && $resp['images']['poster']['thumb'] != '') {
$ret['cover'] = $resp['images']['poster']['thumb'];
} else {
return false;
}
if (isset($resp['images']['banner']['full'])) {
if (isset($resp['images']['banner']['full']) && $resp['images']['banner']['full'] != '') {
$ret['banner'] = $resp['images']['banner']['full'];
} else {
return false;
}
if (isset($resp['ids']['trakt'])) {
$ret['id'] = $resp['ids']['trakt'];