1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2024-11-17 02:14:39 -05:00

new about section :3

This commit is contained in:
Ashley 2022-09-21 10:50:15 +02:00
parent 8ccbe3e182
commit 97e6d472f0

View file

@ -430,7 +430,9 @@ app.get("/search", async (req, res) => {
app.get("/channel/", async (req, res) => { app.get("/channel/", async (req, res) => {
const ID = req.query.id; const ID = req.query.id;
const tab = req.query.tab;
// about // about
const bout = await fetch(config.tubeApi + `channel?id=${ID}&tab=about`); const bout = await fetch(config.tubeApi + `channel?id=${ID}&tab=about`);
@ -441,12 +443,24 @@ app.get("/channel/", async (req, res) => {
const channel = await fetch(config.tubeApi + `channel?id=${ID}&tab=videos`); const channel = await fetch(config.tubeApi + `channel?id=${ID}&tab=videos`);
const c = await channel.text(); const c = await channel.text();
const tj = JSON.parse(toJson(c)); const tj = JSON.parse(toJson(c));
const summary = await wiki.summary(k.Channel.Metadata.Name);
var w = "";
if (summary.title === "Not found.") {
w = "none";
}
if (summary.title !== "Not found.") {
w = summary;
}
const { Subscribers: subscribers } = k.Channel.Metadata; const { Subscribers: subscribers } = k.Channel.Metadata;
renderTemplate(res, req, "channel.ejs", { renderTemplate(res, req, "channel.ejs", {
ID: ID, ID: ID,
tab: tab,
j: k, j: k,
tj: tj, tj: tj,
wiki: w,
about: k.Channel.Contents.ItemSection.About, about: k.Channel.Contents.ItemSection.About,
subs: subs:
typeof subscribers === "string" typeof subscribers === "string"