feat: media result page

This commit is contained in:
2025-04-21 11:30:18 -05:00
parent fb4b7dc71e
commit 77907601f8
24 changed files with 844 additions and 19 deletions

View File

@@ -2,7 +2,9 @@
namespace App\Controller;
use App\Search\Action\Handler\GetMediaInfoHandler;
use App\Search\Action\Handler\SearchHandler;
use App\Search\Action\Input\GetMediaInfoInput;
use App\Search\Action\Input\SearchInput;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
@@ -12,17 +14,30 @@ final class SearchController extends AbstractController
{
public function __construct(
private SearchHandler $searchHandler,
private GetMediaInfoHandler $getMediaInfoHandler,
) {}
#[Route('/search', name: 'app_search', methods: ['GET'])]
public function index(
public function search(
SearchInput $searchInput,
): Response
{
): Response {
$results = $this->searchHandler->handle($searchInput->toCommand());
return $this->render('search/results.html.twig', [
'results' => $results,
]);
}
#[Route('/result/{mediaType}/{tmdbId}', name: 'app_search_result')]
public function result(
GetMediaInfoInput $getDownloadOptionsInput,
): Response {
$result = $this->getMediaInfoHandler->handle(
$getDownloadOptionsInput->toCommand()
);
return $this->render('search/result.html.twig', [
'result' => $result,
]);
}
}