From: Vincent Date: Sun, 3 Jan 2021 12:02:38 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=eb518b70f1a593e1f9b3c4dab457271f7b5ab78d;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e57d132..7c30c75 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,7 @@ - - + diff --git a/scripts/lib/tmdb.php b/scripts/lib/tmdb.php index 722050d..59142ac 100644 --- a/scripts/lib/tmdb.php +++ b/scripts/lib/tmdb.php @@ -363,10 +363,13 @@ class mediaLibrary return $lastModified; } - public function _poster($path) + public function _poster($path, $alt='') { - if ($path === '') { - return ''; + if (null === $path || $path === '') { + if($alt===''){ + return ''; + } + return cacheMedia($alt); } else { return cacheMedia('https://image.tmdb.org/t/p/w500' . $path); } @@ -603,7 +606,7 @@ class moviesLibrary extends mediaLibrary public function shortcut($movie, $prefix, &$res) { $path = $this->_path($movie['path']); - $res[] = ['label' => $movie['data']['title'], 'type' => 'media', 'seen' => $this->_seen($path), 'srt' => hasSRT($path), 'path' => $path, 'poster' => $this->_poster($movie['data']['poster_path'])]; + $res[] = ['label' => $movie['data']['title'], 'type' => 'media', 'seen' => $this->_seen($path), 'srt' => hasSRT($path), 'path' => $path, 'poster' => $this->_poster($movie['data']['poster_path'], dirname($path) . '/poster.jpg')]; }