fix: #9976, handle array or object

isekai-main
Barış Soner Uşaklı 3 years ago
parent 41e0240010
commit 9bfb6c7281

@ -45,14 +45,16 @@ async function searchInContent(data) {
async function doSearch(type, searchIn) { async function doSearch(type, searchIn) {
if (searchIn.includes(data.searchIn)) { if (searchIn.includes(data.searchIn)) {
return await plugins.hooks.fire('filter:search.query', { const result = await plugins.hooks.fire('filter:search.query', {
index: type, index: type,
content: data.query, content: data.query,
matchWords: data.matchWords || 'all', matchWords: data.matchWords || 'all',
cid: searchCids, cid: searchCids,
uid: searchUids, uid: searchUids,
searchData: data, searchData: data,
ids: [],
}); });
return Array.isArray(result) ? result : result.ids;
} }
return []; return [];
} }

Loading…
Cancel
Save