From ab217b240a349d22338942099282d8bfa9a3e9e1 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 12 Oct 2023 03:18:57 +0300 Subject: [PATCH] draft pagination --- src/Controller/SearchController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Controller/SearchController.php b/src/Controller/SearchController.php index 7daf962..e789610 100644 --- a/src/Controller/SearchController.php +++ b/src/Controller/SearchController.php @@ -48,6 +48,8 @@ class SearchController extends AbstractController case 'torrent': + $total = 0; // @TODO pagination + $torrents = []; foreach ($torrentService->searchTorrents($request->query->get('query')) as $torrent) { @@ -60,6 +62,7 @@ class SearchController extends AbstractController $user->getLocales() ) )) { + $total--; continue; } } @@ -69,6 +72,7 @@ class SearchController extends AbstractController { if ($user->isSensitive() && $lastTorrentSensitive->isValue()) { + $total--; continue; } } @@ -76,6 +80,7 @@ class SearchController extends AbstractController // Read file if (!$file = $torrentService->readTorrentFileByTorrentId($torrent->getId())) { + $total--; continue; // @TODO exception }