mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 15:25:41 +01:00
Update index.py
This commit is contained in:
parent
3b3e0136b4
commit
d915c142e2
1 changed files with 4 additions and 6 deletions
|
|
@ -290,8 +290,8 @@ class DelayedQuery:
|
||||||
self._manual_hits_cache: list | None = None
|
self._manual_hits_cache: list | None = None
|
||||||
|
|
||||||
def __len__(self) -> int:
|
def __len__(self) -> int:
|
||||||
manual_hits = self._manual_hits()
|
if self._manual_sort_requested():
|
||||||
if manual_hits is not None:
|
manual_hits = self._manual_hits()
|
||||||
return len(manual_hits)
|
return len(manual_hits)
|
||||||
|
|
||||||
page = self[0:1]
|
page = self[0:1]
|
||||||
|
|
@ -302,8 +302,6 @@ class DelayedQuery:
|
||||||
return ordering.lstrip("-").startswith("custom_field_")
|
return ordering.lstrip("-").startswith("custom_field_")
|
||||||
|
|
||||||
def _manual_hits(self):
|
def _manual_hits(self):
|
||||||
if not self._manual_sort_requested():
|
|
||||||
return None
|
|
||||||
if self._manual_hits_cache is None:
|
if self._manual_hits_cache is None:
|
||||||
q, mask, suggested_correction = self._get_query()
|
q, mask, suggested_correction = self._get_query()
|
||||||
self.suggested_correction = suggested_correction
|
self.suggested_correction = suggested_correction
|
||||||
|
|
@ -351,8 +349,8 @@ class DelayedQuery:
|
||||||
if item.start in self.saved_results:
|
if item.start in self.saved_results:
|
||||||
return self.saved_results[item.start]
|
return self.saved_results[item.start]
|
||||||
|
|
||||||
manual_hits = self._manual_hits()
|
if self._manual_sort_requested():
|
||||||
if manual_hits is not None:
|
manual_hits = self._manual_hits()
|
||||||
start = 0 if item.start is None else item.start
|
start = 0 if item.start is None else item.start
|
||||||
stop = item.stop
|
stop = item.stop
|
||||||
hits = manual_hits[start:stop] if stop is not None else manual_hits[start:]
|
hits = manual_hits[start:stop] if stop is not None else manual_hits[start:]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue