mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 11:38:25 +01:00
fix a issue about search :3
This commit is contained in:
parent
8084da89f2
commit
d3412cb114
1 changed files with 32 additions and 27 deletions
|
@ -74,17 +74,21 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
var continuation = "";
|
var continuation = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!query) {
|
||||||
|
return res.redirect("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (query) {
|
||||||
const search = await modules.fetch(
|
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 text = await search.text();
|
||||||
const j = JSON.parse(modules.toJson(text));
|
const j = JSON.parse(modules.toJson(text));
|
||||||
|
|
||||||
if (!query) {
|
|
||||||
return res.redirect("/");
|
|
||||||
}
|
|
||||||
|
|
||||||
h = " ";
|
h = " ";
|
||||||
|
|
||||||
if (j.Search.Results.DynamicItem) {
|
if (j.Search.Results.DynamicItem) {
|
||||||
|
@ -106,6 +110,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
q: query,
|
q: query,
|
||||||
summary,
|
summary,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/channel/", async (req, res) => {
|
app.get("/channel/", async (req, res) => {
|
||||||
|
|
Loading…
Reference in a new issue