From 9bfd92a011a935c1609c3589b97400acb1ec72c6 Mon Sep 17 00:00:00 2001 From: Brock H Caldwell Date: Sat, 7 Jun 2025 13:18:20 -0500 Subject: [PATCH] feat: links to movies/series download results page from download list component --- src/Tmdb/Tmdb.php | 8 +++++--- templates/components/DownloadListRow.html.twig | 8 ++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Tmdb/Tmdb.php b/src/Tmdb/Tmdb.php index 4366f99..ea1e847 100644 --- a/src/Tmdb/Tmdb.php +++ b/src/Tmdb/Tmdb.php @@ -148,9 +148,11 @@ class Tmdb $result = $finder->findBy($id, ['external_source' => 'imdb_id']); if (count($result['movie_results']) > 0) { - return $result['movie_results'][0]; + return $result['movie_results'][0]['id']; } 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"); @@ -193,7 +195,7 @@ class Tmdb public function mediaDetails(string $id, string $type) { - $id = $this->find($id)['id']; + $id = $this->find($id); if ($type === "movies") { return $this->movieDetails($id); diff --git a/templates/components/DownloadListRow.html.twig b/templates/components/DownloadListRow.html.twig index b4661c5..7e6737a 100644 --- a/templates/components/DownloadListRow.html.twig +++ b/templates/components/DownloadListRow.html.twig @@ -1,9 +1,13 @@ - {{ download.title }} + + {{ download.title }} + {% if download.mediaType == "tvshows" %} - (S{{ download.ptn.season }}E{{ download.ptn.episode }}) + — (S{{ download.ptn.season }}E{{ download.ptn.episode }}) {% endif %}