diff --git a/app/User/Bookmark.php b/app/User/Bookmark.php index 50b2c2c7e..fe9437706 100644 --- a/app/User/Bookmark.php +++ b/app/User/Bookmark.php @@ -247,6 +247,16 @@ class Bookmark extends \Gazelle\BaseUser { ); } + public function tgroupTotal(): int { + return (int)self::$db->scalar(" + SELECT count(*) + FROM bookmarks_torrents + WHERE UserID = ? + ", $this->id + ); + } + + public function artistList(): array { self::$db->prepared_query(" SELECT ag.ArtistID AS artist_id, diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php index 0b7d4b0bd..9add23679 100644 --- a/sections/bookmarks/torrents.php +++ b/sections/bookmarks/torrents.php @@ -34,12 +34,12 @@ $reportMan = new Manager\Report($userMan); $tgMan = new Manager\TGroup(); $torMan = new Manager\Torrent(); $collMan = new Manager\Collage()->setImageProxy(new Util\ImageProxy($Viewer)); +$NumGroups = $bookmark->tgroupTotal(); $paginator = new Util\Paginator(200, (int)($_GET['page'] ?? 1)); -$paginator->setTotal($bookmark->torrentTotal()); +$paginator->setTotal($NumGroups); $bookmarkList = $bookmark->tgroupList($paginator->limit(), $paginator->offset()); -$NumGroups = count($bookmarkList); $artistLeaderboard = $bookmark->tgroupArtistLeaderboard(); $tagLeaderboard = $bookmark->tgroupTagLeaderboard(); $CollageCovers = (int)($Viewer->option('CollageCovers') ?? 25);