fix-feat: ajax download call

This commit is contained in:
2025-04-23 16:17:03 -05:00
parent 5402680abf
commit 6dc6fbd449
15 changed files with 153 additions and 19 deletions

View File

@@ -18,7 +18,11 @@ class DownloadController extends AbstractController
public function download(
DownloadMediaInput $input,
): Response {
$this->bus->dispatch($input->toCommand());
try {
$this->bus->dispatch($input->toCommand());
} catch (\Throwable $exception) {
return $this->json(['error' => $exception->getMessage()], Response::HTTP_INTERNAL_SERVER_ERROR);
}
return $this->json(['status' => 200, 'message' => 'Added to Queue']);
}

View File

@@ -17,7 +17,7 @@ final class TorrentioController extends AbstractController
private readonly GetTvShowOptionsHandler $getTvShowOptionsHandler,
) {}
#[Route('/torrentio/movies/{imdbId}', name: 'app_torrentio_movies')]
#[Route('/torrentio/movies/{tmdbId}/{imdbId}', name: 'app_torrentio_movies')]
public function movieOptions(GetMovieOptionsInput $input): Response
{
$results = $this->getMovieOptionsHandler->handle($input->toCommand());