Browse Source

Fix Ombi Missing Image for TVShow Posters that do not come with Full URL

From what i saw in the code, this seems like a common occurrence, patched this line so that the poster for TVShows in the request row shows up properly. Tested in my Organizr install against latest Dev Ombi.
Paulo Constança 5 years ago
parent
commit
3c9e6f53fd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      api/homepage/ombi.php

+ 2 - 2
api/homepage/ombi.php

@@ -303,7 +303,7 @@ trait OmbiHomepageItem
 									'id' => $value['tvDbId'],
 									'title' => $value['title'],
 									'overview' => $value['overview'],
-									'poster' => (isset($value['posterPath']) && $value['posterPath'] !== '') ? $value['posterPath'] : 'plugins/images/cache/no-list.png',
+									'poster' => (isset($value['posterPath']) && $value['posterPath'] !== '') ? (str_starts_with($value['posterPath'], '/') ? 'https://image.tmdb.org/t/p/w300/' . $value['posterPath'] : $value['posterPath']) : 'plugins/images/cache/no-list.png',
 									'background' => (isset($value['background']) && $value['background'] !== '') ? 'https://image.tmdb.org/t/p/w1280/' . $value['background'] : '',
 									'approved' => $value['childRequests'][0]['approved'],
 									'available' => $value['childRequests'][0]['available'],
@@ -545,4 +545,4 @@ trait OmbiHomepageItem
 	{
 		return $type == $this->config['ombiTvDefault'];
 	}
-}
+}