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 @@ + -

Search Results

+

Media Results

- + +
+ +
+

+ {{ results.media.title }} - {{ results.media.year }} +

+

+ {{ results.media.description }} +

+
+
+ +
+
diff --git a/templates/torrentio/index.html.twig b/templates/torrentio/index.html.twig new file mode 100644 index 0000000..a7e4147 --- /dev/null +++ b/templates/torrentio/index.html.twig @@ -0,0 +1,20 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello TorrentioController!{% endblock %} + +{% block body %} + + +
+

Hello {{ controller_name }}! ✅

+ + This friendly message is coming from: + +
+{% endblock %} diff --git a/templates/torrentio/movies.html.twig b/templates/torrentio/movies.html.twig new file mode 100644 index 0000000..4a88f5c --- /dev/null +++ b/templates/torrentio/movies.html.twig @@ -0,0 +1,67 @@ + + +
+ + + + + + + + + + + + + + {% for result in results.results %} + + + + + + + + + + {% endfor %} + +
+ Size + + Resolution + + Codec + + Seeders + + Provider + + Language + +
+ {{ result.size }} + + {{ result.resolution }} + + {{ result.codec }} + + {{ result.seeders }} + + {{ result.provider }} + + {{ result.languageFlags }} + + + Download + + +
+
\ No newline at end of file diff --git a/templates/torrentio/tvshows.html.twig b/templates/torrentio/tvshows.html.twig new file mode 100644 index 0000000..5417f46 --- /dev/null +++ b/templates/torrentio/tvshows.html.twig @@ -0,0 +1,3 @@ +
+

Episodes

+
\ No newline at end of file