mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 00:17:49 +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 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;
|
let j = null;
|
||||||
if (req.query.mobilesearch) {
|
if (req.query.mobilesearch) {
|
||||||
const query = req.query.mobilesearch;
|
const query = req.query.mobilesearch;
|
||||||
|
@ -59,6 +64,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
renderTemplate(res, req, "discover.ejs", {
|
renderTemplate(res, req, "discover.ejs", {
|
||||||
tab: req.query.tab,
|
tab: req.query.tab,
|
||||||
isMobile: req.useragent.isMobile,
|
isMobile: req.useragent.isMobile,
|
||||||
|
p,
|
||||||
mobilesearch: req.query.mobilesearch,
|
mobilesearch: req.query.mobilesearch,
|
||||||
inv: t,
|
inv: t,
|
||||||
turntomins,
|
turntomins,
|
||||||
|
@ -74,7 +80,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
|
|
||||||
const rendermainpage = () => {
|
const rendermainpage = () => {
|
||||||
if (req.useragent.isMobile) {
|
if (req.useragent.isMobile) {
|
||||||
return res.redirect("/app?tab=search");
|
return res.redirect("/app");
|
||||||
}
|
}
|
||||||
|
|
||||||
return renderTemplate(res, req, "landing.ejs", {
|
return renderTemplate(res, req, "landing.ejs", {
|
||||||
|
|
Loading…
Reference in a new issue