diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index 3c0b596..a0c5ee2 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -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, ]); } } diff --git a/src/Controller/TorrentioController.php b/src/Controller/TorrentioController.php new file mode 100644 index 0000000..37e5cfb --- /dev/null +++ b/src/Controller/TorrentioController.php @@ -0,0 +1,26 @@ +getMovieOptionsHandler->handle($input->toCommand()); + + return $this->render('torrentio/movies.html.twig', [ + 'results' => $results, + ]); + } +} diff --git a/src/Download/Action/Handler/GetDownloadOptionsHandler.php b/src/Download/Action/Handler/GetDownloadOptionsHandler.php index 32daa81..ed569a3 100644 --- a/src/Download/Action/Handler/GetDownloadOptionsHandler.php +++ b/src/Download/Action/Handler/GetDownloadOptionsHandler.php @@ -3,7 +3,7 @@ namespace App\Download\Action\Handler; use App\Tmdb\Tmdb; -use App\Torrentio\Torrentio; +use App\Torrentio\Client\Torrentio; use OneToMany\RichBundle\Contract\CommandInterface; use OneToMany\RichBundle\Contract\HandlerInterface; use OneToMany\RichBundle\Contract\ResultInterface; diff --git a/src/Torrentio/Action/Command/GetMovieOptionsCommand.php b/src/Torrentio/Action/Command/GetMovieOptionsCommand.php new file mode 100644 index 0000000..8dfeb75 --- /dev/null +++ b/src/Torrentio/Action/Command/GetMovieOptionsCommand.php @@ -0,0 +1,12 @@ +torrentio->search($command->imdbId, 'movies') + ); + } +} diff --git a/src/Torrentio/Action/Input/GetMovieOptionsInput.php b/src/Torrentio/Action/Input/GetMovieOptionsInput.php new file mode 100644 index 0000000..b5a9653 --- /dev/null +++ b/src/Torrentio/Action/Input/GetMovieOptionsInput.php @@ -0,0 +1,21 @@ +imdbId); + } +} diff --git a/src/Torrentio/Action/Result/GetMovieOptionsResult.php b/src/Torrentio/Action/Result/GetMovieOptionsResult.php new file mode 100644 index 0000000..4e77a33 --- /dev/null +++ b/src/Torrentio/Action/Result/GetMovieOptionsResult.php @@ -0,0 +1,12 @@ + -
+ {{ results.media.description }} +
+/var/www/src/Controller/TorrentioController.php/var/www/templates/torrentio/index.html.twig| + Size + | ++ Resolution + | ++ Codec + | ++ Seeders + | ++ Provider + | ++ Language + | ++ | +
|---|---|---|---|---|---|---|
| + {{ result.size }} + | ++ {{ result.resolution }} + | ++ {{ result.codec }} + | ++ {{ result.seeders }} + | ++ {{ result.provider }} + | ++ {{ result.languageFlags }} + | ++ + Download + + + | +