Sort search results by votes and package name
This commit is contained in:
parent
890ab32084
commit
8448bae508
2
saury
2
saury
|
@ -75,7 +75,7 @@ function aur_search
|
||||||
set rpc_response_type (echo $rpc_response | jq -r '.type')
|
set rpc_response_type (echo $rpc_response | jq -r '.type')
|
||||||
|
|
||||||
if test "$rpc_response_type" = "search"
|
if test "$rpc_response_type" = "search"
|
||||||
set results (echo $rpc_response | jq -r '.results | map(.Name, .PackageBase, .Description, .Version, .OutOfDate != null, .NumVotes, (.Popularity * 100 | round / 100))[]')
|
set results (echo $rpc_response | jq -r '.results | sort_by(.NumVotes, (.Name | explode | map(-.))) | reverse | map(.Name, .PackageBase, .Description, .Version, .OutOfDate != null, .NumVotes, (.Popularity * 100 | round / 100))[]')
|
||||||
|
|
||||||
for i in (seq (math (count $results) / 7))
|
for i in (seq (math (count $results) / 7))
|
||||||
set name $results[(math $i \* 7 - 6)]
|
set name $results[(math $i \* 7 - 6)]
|
||||||
|
|
Loading…
Reference in New Issue