mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(rpc): add search type handler
This commit introduces a PackageSearch-derivative class: `RPCSearch`. This derivative modifies callback behavior of PackageSearch to suit RPC searches, including [make|check|opt]depends `by` types. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
ece25e0499
commit
af2f3694e7
5 changed files with 245 additions and 37 deletions
|
@ -9,6 +9,9 @@ PP = 50
|
|||
# A whitelist of valid PP values
|
||||
PP_WHITELIST = {50, 100, 250}
|
||||
|
||||
# Default `by` parameter for RPC search.
|
||||
RPC_SEARCH_BY = "name-desc"
|
||||
|
||||
|
||||
def fallback_pp(per_page: int) -> int:
|
||||
""" If `per_page` is a valid value in PP_WHITELIST, return it.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue