feat: torrentio api for movie results
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
26
src/Controller/TorrentioController.php
Normal file
26
src/Controller/TorrentioController.php
Normal 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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user