misc.search: fix librey results not being array after update

This commit is contained in:
Cynthia Foxwell 2024-04-04 14:35:52 -06:00
parent 019c8a0619
commit 73658b5be1

View file

@ -573,7 +573,8 @@ search.callback = async function (msg, line, args, {results = 2}) {
const res = await fetch(`${librex}/api.php?q=${encodedQuery}&p=0&t=0`).then(
(res) => res.json()
);
const searchResults = res
delete res.results_source;
const searchResults = Array.from(res)
.filter((result) => !("did_you_mean" in result))
.splice(0, Number(results));