mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-28 17:49:01 +01:00
fix a issue about search :3
This commit is contained in:
parent
104eb86429
commit
544169c40e
1 changed files with 32 additions and 27 deletions
|
@ -74,17 +74,21 @@ module.exports = function (app, config, renderTemplate) {
|
|||
var continuation = "";
|
||||
}
|
||||
|
||||
if (!query) {
|
||||
return res.redirect("/");
|
||||
}
|
||||
|
||||
if (query) {
|
||||
const search = await modules.fetch(
|
||||
`https://tube-srv.ashley143.gay/api/search?query=${query.replace("&", "and")}&continuation=${continuation}`
|
||||
`https://tube-srv.ashley143.gay/api/search?query=${query.replace(
|
||||
"&",
|
||||
"and"
|
||||
)}&continuation=${continuation}`
|
||||
);
|
||||
|
||||
const text = await search.text();
|
||||
const j = JSON.parse(modules.toJson(text));
|
||||
|
||||
if (!query) {
|
||||
return res.redirect("/");
|
||||
}
|
||||
|
||||
h = " ";
|
||||
|
||||
if (j.Search.Results.DynamicItem) {
|
||||
|
@ -106,6 +110,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
q: query,
|
||||
summary,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/channel/", async (req, res) => {
|
||||
|
|
Loading…
Reference in a new issue