fix: turbo frame for tvshow results

This commit is contained in:
2025-07-14 20:54:12 -05:00
parent f2971eee9c
commit f610297294
4 changed files with 40 additions and 38 deletions

View File

@@ -35,8 +35,8 @@ final class WebController extends AbstractController
$input->imdbId
);
// return $cache->get($cacheId, function (ItemInterface $item) use ($input, $request) {
// $item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
return $cache->get($cacheId, function (ItemInterface $item) use ($input, $request) {
$item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
$results = $this->getMovieOptionsHandler->handle($input->toCommand());
if ($request->headers->get('Turbo-Frame')) {
@@ -46,11 +46,11 @@ final class WebController extends AbstractController
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
public function tvShowOptions(GetTvShowOptionsInput $input, CacheInterface $cache, Request $request): Response
{
$cacheId = sprintf(
"page.torrentio.tvshows.%s.%s.%s.%s",
@@ -61,9 +61,14 @@ final class WebController extends AbstractController
);
try {
// return $cache->get($cacheId, function (ItemInterface $item) use ($input) {
// return $cache->get($cacheId, function (ItemInterface $item) use ($input, $request) {
// $item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
$results = $this->getTvShowOptionsHandler->handle($input->toCommand());
if ($request->headers->get('Turbo-Frame')) {
return $this->sendFragmentResponse($results, $request);
}
return $this->render('torrentio/tvshows.html.twig', [
'results' => $results,
]);