feat: torrentio api for movie results

This commit is contained in:
2025-04-21 16:11:57 -05:00
parent 77907601f8
commit fb4651c925
14 changed files with 210 additions and 13 deletions

View File

@@ -32,12 +32,10 @@ final class SearchController extends AbstractController
public function result(
GetMediaInfoInput $getDownloadOptionsInput,
): Response {
$result = $this->getMediaInfoHandler->handle(
$getDownloadOptionsInput->toCommand()
);
$result = $this->getMediaInfoHandler->handle($getDownloadOptionsInput->toCommand());
return $this->render('search/result.html.twig', [
'result' => $result,
'results' => $result,
]);
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Controller;
use App\Torrentio\Action\Handler\GetMovieOptionsHandler;
use App\Torrentio\Action\Input\GetMovieOptionsInput;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
final class TorrentioController extends AbstractController
{
public function __construct(
private readonly GetMovieOptionsHandler $getMovieOptionsHandler,
) {}
#[Route('/torrentio/movies/{imdbId}', name: 'app_torrentio')]
public function index(GetMovieOptionsInput $input): Response
{
$results = $this->getMovieOptionsHandler->handle($input->toCommand());
return $this->render('torrentio/movies.html.twig', [
'results' => $results,
]);
}
}