misc.search: fix librey results not being array after update
This commit is contained in:
parent
019c8a0619
commit
73658b5be1
1 changed files with 2 additions and 1 deletions
|
@ -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(
|
const res = await fetch(`${librex}/api.php?q=${encodedQuery}&p=0&t=0`).then(
|
||||||
(res) => res.json()
|
(res) => res.json()
|
||||||
);
|
);
|
||||||
const searchResults = res
|
delete res.results_source;
|
||||||
|
const searchResults = Array.from(res)
|
||||||
.filter((result) => !("did_you_mean" in result))
|
.filter((result) => !("did_you_mean" in result))
|
||||||
.splice(0, Number(results));
|
.splice(0, Number(results));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue