Skip to content

Commit b7e908d

Browse files
authored
Add sort parameter to GET request in api.py (#11514)
* Add sort parameter to GET request in api.py
1 parent b03df2c commit b7e908d

File tree

1 file changed

+4
-1
lines changed
  • openlibrary/plugins/openlibrary

1 file changed

+4
-1
lines changed

openlibrary/plugins/openlibrary/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,14 +807,17 @@ class opds_search(delegate.page):
807807
def GET(self):
808808
from pyopds2 import Catalog, Link, Metadata
809809

810-
i = web.input(query="trending_score_hourly_sum:[1 TO *]", limit=25, page=1)
810+
i = web.input(
811+
query="trending_score_hourly_sum:[1 TO *]", limit=25, page=1, sort=None
812+
)
811813
provider = get_opds_data_provider()
812814
catalog = Catalog.create(
813815
metadata=Metadata(title=_("Search Results")),
814816
response=provider.search(
815817
query=i.query,
816818
limit=int(i.limit),
817819
offset=(int(i.page) - 1) * int(i.limit),
820+
sort=i.sort,
818821
),
819822
links=[
820823
Link(

0 commit comments

Comments
 (0)