feat: links to movies/series download results page from download list component

This commit is contained in:
2025-06-07 13:18:20 -05:00
parent ac6276f444
commit 9bfd92a011
2 changed files with 11 additions and 5 deletions

View File

@@ -148,9 +148,11 @@ class Tmdb
$result = $finder->findBy($id, ['external_source' => 'imdb_id']); $result = $finder->findBy($id, ['external_source' => 'imdb_id']);
if (count($result['movie_results']) > 0) { if (count($result['movie_results']) > 0) {
return $result['movie_results'][0]; return $result['movie_results'][0]['id'];
} elseif (count($result['tv_results']) > 0) { } elseif (count($result['tv_results']) > 0) {
return $result['tv_results'][0]; return $result['tv_results'][0]['id'];
} elseif (count($result['tv_episode_results']) > 0) {
return $result['tv_episode_results'][0]['show_id'];
} }
throw new \Exception("No results found for $id"); throw new \Exception("No results found for $id");
@@ -193,7 +195,7 @@ class Tmdb
public function mediaDetails(string $id, string $type) public function mediaDetails(string $id, string $type)
{ {
$id = $this->find($id)['id']; $id = $this->find($id);
if ($type === "movies") { if ($type === "movies") {
return $this->movieDetails($id); return $this->movieDetails($id);

View File

@@ -1,9 +1,13 @@
<tr{{ attributes }} id="ad_download_{{ download.id }}"> <tr{{ attributes }} id="ad_download_{{ download.id }}">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-stone-800 truncate"> <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-stone-800 truncate">
{{ download.title }} <a href="{{ path('app_search_result', {imdbId: download.imdbId, mediaType: download.mediaType}) }}"
class="hover:underline mr-1"
>
{{ download.title }}
</a>
{% if download.mediaType == "tvshows" %} {% if download.mediaType == "tvshows" %}
(S{{ download.ptn.season }}E{{ download.ptn.episode }}) &mdash; <span class="ml-1">(S{{ download.ptn.season }}E{{ download.ptn.episode }})</span>
{% endif %} {% endif %}
</td> </td>