From eb518b70f1a593e1f9b3c4dab457271f7b5ab78d Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 3 Jan 2021 13:02:38 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 22 +++++++++++----------- scripts/lib/tmdb.php | 11 +++++++---- 2 files changed, 18 insertions(+), 15 deletions(-) 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')]; } -- 2.39.5