Fix errors found by testing

This commit is contained in:
DariusIII
2026-02-24 13:04:39 +01:00
parent 041321d51d
commit 3fe2a54b14
8 changed files with 110 additions and 314 deletions
+5 -2
View File
@@ -120,7 +120,7 @@ class BookService
.$catsrch.' '
.$exccatlist;
$cacheKey = md5('book_range_'.$baseWhere.$order[0].$order[1].$start.$num.$page); // @phpstan-ignore offsetAccess.notFound
$cacheKey = md5('book_range_'.$baseWhere.$order[0].$order[1].$start.$num.$page);
$cached = Cache::get($cacheKey);
if ($cached !== null) {
@@ -148,7 +148,7 @@ class BookService
.'INNER JOIN releases r ON boo.id = r.bookinfo_id '
.'WHERE '.$baseWhere.' '
.'GROUP BY boo.id, boo.title, boo.author, boo.cover, boo.publisher, boo.publishdate, boo.review, boo.url '
."ORDER BY {$order[0]} {$order[1]} " // @phpstan-ignore offsetAccess.notFound
."ORDER BY {$order[0]} {$order[1]} "
."LIMIT {$num} OFFSET {$start}";
$books = BookInfo::fromQuery($bookSql);
@@ -210,6 +210,9 @@ class BookService
*
* @return array<string, mixed>
*/
/**
* @return array{0: string, 1: string}
*/
public function getBookOrder(string $orderBy): array
{
$order = $orderBy === '' ? 'r.postdate' : $orderBy;