From d6328786bad1c1d4398bcaa7e0bf0c0812f62083 Mon Sep 17 00:00:00 2001 From: Brock H Caldwell Date: Tue, 22 Apr 2025 10:04:14 -0500 Subject: [PATCH] fix: frontend cleanup --- .../controllers/result_filter_controller.js | 10 ++ src/Controller/SearchController.php | 8 ++ templates/search/result.html.twig | 74 ++++++++-- templates/torrentio/movies.html.twig | 134 +++++++++--------- templates/torrentio/tvshows.html.twig | 5 +- 5 files changed, 157 insertions(+), 74 deletions(-) create mode 100644 assets/controllers/result_filter_controller.js diff --git a/assets/controllers/result_filter_controller.js b/assets/controllers/result_filter_controller.js new file mode 100644 index 0000000..c07f69b --- /dev/null +++ b/assets/controllers/result_filter_controller.js @@ -0,0 +1,10 @@ +import { Controller } from '@hotwired/stimulus'; + +/* +* The following line makes this controller "lazy": it won't be downloaded until needed +* See https://github.com/symfony/stimulus-bridge#lazy-controllers +*/ +/* stimulusFetch: 'lazy' */ +export default class extends Controller { + // ... +} diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index a0c5ee2..5ca8fa4 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -36,6 +36,14 @@ final class SearchController extends AbstractController return $this->render('search/result.html.twig', [ 'results' => $result, + 'filter' => [ + 'resolution' => '', + 'codec' => '', + 'provider' => '', + 'language' => '', + 'season' => 1, + 'episode' => '' + ] ]); } } diff --git a/templates/search/result.html.twig b/templates/search/result.html.twig index 8048a97..447eaac 100644 --- a/templates/search/result.html.twig +++ b/templates/search/result.html.twig @@ -17,15 +17,72 @@ {{ results.media.description }}

- +
+ + + + + {% if results.media.mediaType == "tvshows" %} + + + {% endif %} +
+ {% if "movies" == results.media.mediaType %} -
+
{% elseif "tvshows" == results.media.mediaType %} {% for season, episodes in results.media.episodes %} @@ -33,13 +90,12 @@ {% for episode in episodes %}
{% endfor %} {% endfor %} diff --git a/templates/torrentio/movies.html.twig b/templates/torrentio/movies.html.twig index 4a88f5c..61833c1 100644 --- a/templates/torrentio/movies.html.twig +++ b/templates/torrentio/movies.html.twig @@ -1,67 +1,73 @@ -
- - - - - - - - - - - - - - {% 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 - - -
+
+
+ + + + + + + + + + + + + + {% 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 index dfef708..65be303 100644 --- a/templates/torrentio/tvshows.html.twig +++ b/templates/torrentio/tvshows.html.twig @@ -11,7 +11,7 @@
+ {{ stimulus_action('tv-results', 'toggleList', 'click') }}> @@ -84,6 +84,9 @@ {% endfor %} + + {{ results.results|length }} results +