Prevent negative offset when browsing

This commit is contained in:
DariusIII
2024-10-23 11:02:00 +02:00
parent 01ecb472e5
commit 6bd0212a47
7 changed files with 22 additions and 0 deletions
+3
View File
@@ -104,6 +104,9 @@ class Books
public function getBookRange($page, $cat, $start, $num, $orderBy, array $excludedCats = []): array
{
$page = max(1, $page);
$start = max(1, $start);
$browseby = $this->getBrowseBy();
$catsrch = '';
if (\count($cat) > 0 && $cat[0] !== -1) {
+3
View File
@@ -137,6 +137,9 @@ class Console
*/
public function getConsoleRange($page, $cat, $start, $num, $orderBy, array $excludedCats = []): array
{
$page = max(1, $page);
$start = max(1, $start);
$browseBy = $this->getBrowseBy();
$catsrch = '';
if (\count($cat) > 0 && (int) $cat[0] !== -1) {
+4
View File
@@ -168,6 +168,10 @@ class Games
*/
public function getGamesRange($page, $cat, $start, $num, array|string $orderBy = '', string $maxAge = '', array $excludedCats = []): array
{
$page = max(1, $page);
$start = max(1, $start);
$browseBy = $this->getBrowseBy();
$catsrch = '';
if (\count($cat) > 0 && $cat[0] !== -1) {
+3
View File
@@ -167,6 +167,9 @@ class Movie
*/
public function getMovieRange($page, $cat, $start, $num, $orderBy, int $maxAge = -1, array $excludedCats = [])
{
$page = max(1, $page);
$start = max(1, $start);
$catsrch = '';
if (\count($cat) > 0 && $cat[0] !== -1) {
$catsrch = Category::getCategorySearch($cat);
+3
View File
@@ -127,6 +127,9 @@ class Music
*/
public function getMusicRange($page, $cat, $start, $num, $orderBy, array $excludedCats = []): mixed
{
$page = max(1, $page);
$start = max(1, $start);
$browseby = $this->getBrowseBy();
$catsrch = '';
if (\count($cat) > 0 && (int) $cat[0] !== -1) {
+3
View File
@@ -50,6 +50,9 @@ class Releases extends Release
*/
public function getBrowseRange($page, $cat, $start, $num, $orderBy, int $maxAge = -1, array $excludedCats = [], int|string $groupName = -1, int $minSize = 0): mixed
{
$page = max(1, $page);
$start = max(1, $start);
$orderBy = $this->getBrowseOrder($orderBy);
$qry = sprintf(
+3
View File
@@ -71,6 +71,9 @@ class XXX
*/
public function getXXXRange($page, $cat, $start, $num, $orderBy, int $maxAge = -1, array $excludedCats = []): array
{
$page = max(1, $page);
$start = max(1, $start);
$catSrch = '';
if (\count($cat) > 0 && $cat[0] !== -1) {
$catSrch = Category::getCategorySearch($cat);