Fix calculating total torrent bookmarks

This commit is contained in:
itismadness
2025-09-08 02:06:23 +00:00
committed by Spine
parent f16b0d1d8a
commit d9b4588a1d
2 changed files with 12 additions and 2 deletions

View File

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

View File

@@ -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);