Browse Source

draft pagination

main
ghost 1 year ago
parent
commit
ab217b240a
  1. 5
      src/Controller/SearchController.php

5
src/Controller/SearchController.php

@ -48,6 +48,8 @@ class SearchController extends AbstractController @@ -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 @@ -60,6 +62,7 @@ class SearchController extends AbstractController
$user->getLocales()
)
)) {
$total--;
continue;
}
}
@ -69,6 +72,7 @@ class SearchController extends AbstractController @@ -69,6 +72,7 @@ class SearchController extends AbstractController
{
if ($user->isSensitive() && $lastTorrentSensitive->isValue())
{
$total--;
continue;
}
}
@ -76,6 +80,7 @@ class SearchController extends AbstractController @@ -76,6 +80,7 @@ class SearchController extends AbstractController
// Read file
if (!$file = $torrentService->readTorrentFileByTorrentId($torrent->getId()))
{
$total--;
continue; // @TODO exception
}

Loading…
Cancel
Save