From 20ade478b1b4d0eafcf68716d0d828c0c0dd0dbf Mon Sep 17 00:00:00 2001 From: Brock H Caldwell Date: Thu, 8 May 2025 23:47:08 -0500 Subject: [PATCH] feat: adds episode air date to results --- src/Controller/TorrentioController.php | 6 +++--- src/Tmdb/Tmdb.php | 1 + src/Tmdb/TmdbResult.php | 1 + templates/broadcast/Download.stream.html.twig | 6 +----- templates/torrentio/tvshows.html.twig | 8 +++++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Controller/TorrentioController.php b/src/Controller/TorrentioController.php index 963fcf6..c5fb8b3 100644 --- a/src/Controller/TorrentioController.php +++ b/src/Controller/TorrentioController.php @@ -48,12 +48,12 @@ final class TorrentioController extends AbstractController $input->episode, ); - return $cache->get($cacheId, function (ItemInterface $item) use ($input) { - $item->expiresAt(new \DateTimeImmutable("today 11:59 pm")); +// return $cache->get($cacheId, function (ItemInterface $item) use ($input) { +// $item->expiresAt(new \DateTimeImmutable("today 11:59 pm")); $results = $this->getTvShowOptionsHandler->handle($input->toCommand()); return $this->render('torrentio/tvshows.html.twig', [ 'results' => $results, ]); - }); +// }); } } diff --git a/src/Tmdb/Tmdb.php b/src/Tmdb/Tmdb.php index cca86fd..d4b964b 100644 --- a/src/Tmdb/Tmdb.php +++ b/src/Tmdb/Tmdb.php @@ -241,6 +241,7 @@ class Tmdb year: (new \DateTime($data['air_date']))->format('Y'), mediaType: "tvshows", episodes: null, + episodeAirDate: (new \DateTime($data['air_date']))->format('m/d/Y'), ); } diff --git a/src/Tmdb/TmdbResult.php b/src/Tmdb/TmdbResult.php index 2875d8e..bad4fd6 100644 --- a/src/Tmdb/TmdbResult.php +++ b/src/Tmdb/TmdbResult.php @@ -13,5 +13,6 @@ class TmdbResult public ?string $year = "", public ?string $mediaType = "", public ?array $episodes = null, + public ?string $episodeAirDate = null, ) {} } diff --git a/templates/broadcast/Download.stream.html.twig b/templates/broadcast/Download.stream.html.twig index 0bbd270..8ee5ddb 100644 --- a/templates/broadcast/Download.stream.html.twig +++ b/templates/broadcast/Download.stream.html.twig @@ -15,11 +15,7 @@ - - - + {% endblock %} {% block update %} diff --git a/templates/torrentio/tvshows.html.twig b/templates/torrentio/tvshows.html.twig index d0299dd..78a9358 100644 --- a/templates/torrentio/tvshows.html.twig +++ b/templates/torrentio/tvshows.html.twig @@ -4,11 +4,13 @@

{{ results.episode }}. {{ results.media.title }}

{{ results.media.description }}

- +
{{ results.results|length }} results - + {{ results.media.episodeAirDate }} +