mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Update result sorting
This commit is contained in:
@@ -2430,7 +2430,12 @@ class ManticoreSearchDriver implements SearchDriverInterface
|
||||
if (! in_array($sortField, $allowedSort, true)) {
|
||||
$sortField = 'postdate_ts';
|
||||
}
|
||||
$query->sort($sortField, $sortDir === 'asc' ? 'asc' : 'desc');
|
||||
$order = $sortDir === 'asc' ? 'asc' : 'desc';
|
||||
$query->sort($sortField, $order);
|
||||
if ($sortField !== 'id') {
|
||||
// Stabilize ordering across pages when primary sort values are equal.
|
||||
$query->sort('id', $order);
|
||||
}
|
||||
|
||||
$maxNeed = max(1000, $offset + $limit + 100);
|
||||
$query->maxMatches(min($maxNeed, (int) ($this->config['max_matches'] ?? 10000)));
|
||||
|
||||
Reference in New Issue
Block a user