update: add fallback images to quicksearch

This commit is contained in:
Roardom
2025-02-13 10:45:41 +00:00
parent 211ea33a38
commit aa57a375cd
2 changed files with 28 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ class QuickSearchController extends Controller
'id' => $hit['id'],
'name' => $hit[$type]['name'],
'year' => $hit[$type]['year'],
'image' => $hit[$type]['poster'] ? tmdb_image('poster_small', $hit[$type]['poster']) : 'https://via.placeholder.com/90x135',
'image' => $hit[$type]['poster'] ? tmdb_image('poster_small', $hit[$type]['poster']) : ($hit['name'][0] ?? '').($hit['name'][1] ?? ''),
'url' => route('torrents.similar', ['category_id' => $hit['category']['id'], 'tmdb' => $hit['tmdb']]),
'type' => $type === 'movie' ? 'Movie' : 'TV Series',
];
@@ -96,7 +96,7 @@ class QuickSearchController extends Controller
'id' => $hit['id'],
'name' => $hit['name'],
'year' => $hit['birthday'],
'image' => $hit['still'] ? tmdb_image('poster_small', $hit['still']) : 'https://via.placeholder.com/90x135',
'image' => $hit['still'] ? tmdb_image('poster_small', $hit['still']) : ($hit['name'][0] ?? '').(str($hit['name'])->explode(' ')->last()[0] ?? ''),
'url' => route('mediahub.persons.show', ['id' => $hit['id']]),
'type' => 'Person',
];