tmdbId, $input->imdbId ); return $cache->get($cacheId, function (ItemInterface $item) use ($input) { $item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0)); $results = $this->getMovieOptionsHandler->handle($input->toCommand()); return $this->render('torrentio/movies.html.twig', [ 'results' => $results, ]); }); } #[Route('/torrentio/tvshows/{tmdbId}/{imdbId}/{season?}/{episode?}', name: 'app_torrentio_tvshows')] public function tvShowOptions(GetTvShowOptionsInput $input, CacheInterface $cache): Response { $cacheId = sprintf( "page.torrentio.tvshows.%s.%s.%s.%s", $input->tmdbId, $input->imdbId, $input->season, $input->episode, ); return $cache->get($cacheId, function (ItemInterface $item) use ($input) { $item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0)); $results = $this->getTvShowOptionsHandler->handle($input->toCommand()); return $this->render('torrentio/tvshows.html.twig', [ 'results' => $results, ]); }); } #[Route('/torrentio/tvshows/clear/{tmdbId}/{imdbId}/{season?}/{episode?}', name: 'app_clear_torrentio_tvshows')] public function clearTvShowOptions(GetTvShowOptionsInput $input, CacheInterface $cache, Request $request): Response { $cacheId = sprintf( "page.torrentio.tvshows.%s.%s.%s.%s", $input->tmdbId, $input->imdbId, $input->season, $input->episode, ); $cache->delete($cacheId); $this->broadcaster->alert( title: 'Success', message: 'Torrentio cache Cleared.' ); return $cache->get($cacheId, function (ItemInterface $item) use ($input) { $item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0)); $results = $this->getTvShowOptionsHandler->handle($input->toCommand()); return $this->render('torrentio/tvshows.html.twig', [ 'results' => $results, ]); }); } }