mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-25 18:28:37 +01:00
add new popular page
This commit is contained in:
parent
dad91089b9
commit
75bfa149c0
1 changed files with 7 additions and 1 deletions
|
@ -45,6 +45,11 @@ module.exports = function (app, config, renderTemplate) {
|
|||
);
|
||||
const t = getJson(await invtrend.text());
|
||||
|
||||
const invpopular = await fetch(
|
||||
`https://invid-api.poketube.fun/api/v1/popular`
|
||||
);
|
||||
const p = getJson(await invpopular.text());
|
||||
|
||||
let j = null;
|
||||
if (req.query.mobilesearch) {
|
||||
const query = req.query.mobilesearch;
|
||||
|
@ -59,6 +64,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
renderTemplate(res, req, "discover.ejs", {
|
||||
tab: req.query.tab,
|
||||
isMobile: req.useragent.isMobile,
|
||||
p,
|
||||
mobilesearch: req.query.mobilesearch,
|
||||
inv: t,
|
||||
turntomins,
|
||||
|
@ -74,7 +80,7 @@ module.exports = function (app, config, renderTemplate) {
|
|||
|
||||
const rendermainpage = () => {
|
||||
if (req.useragent.isMobile) {
|
||||
return res.redirect("/app?tab=search");
|
||||
return res.redirect("/app");
|
||||
}
|
||||
|
||||
return renderTemplate(res, req, "landing.ejs", {
|
||||
|
|
Loading…
Reference in a new issue