mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-24 18:38:40 +01:00
fix some issues on the channel page
This commit is contained in:
parent
2f7ecbd37b
commit
005ba9f0bb
1 changed files with 9 additions and 3 deletions
12
server.js
12
server.js
|
@ -431,8 +431,6 @@ 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;
|
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`);
|
||||||
|
@ -455,18 +453,26 @@ app.get("/channel/", async (req, res) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const { Subscribers: subscribers } = k.Channel.Metadata;
|
const { Subscribers: subscribers } = k.Channel.Metadata;
|
||||||
|
const description = k.Channel.Contents.ItemSection.About.Description
|
||||||
|
|
||||||
|
var d = description.toString().replace(/\n/g, " <br> ")
|
||||||
|
if(d === "[object Object]"){
|
||||||
|
var d = ""
|
||||||
|
}
|
||||||
|
|
||||||
renderTemplate(res, req, "channel.ejs", {
|
renderTemplate(res, req, "channel.ejs", {
|
||||||
ID: ID,
|
ID: ID,
|
||||||
tab: tab,
|
tab: tab,
|
||||||
j: k,
|
j: k,
|
||||||
tj: tj,
|
tj: tj,
|
||||||
wiki: w,
|
wiki: w,
|
||||||
|
isMobile: req.useragent.isMobile,
|
||||||
about: k.Channel.Contents.ItemSection.About,
|
about: k.Channel.Contents.ItemSection.About,
|
||||||
subs:
|
subs:
|
||||||
typeof subscribers === "string"
|
typeof subscribers === "string"
|
||||||
? subscribers.replace("subscribers", "")
|
? subscribers.replace("subscribers", "")
|
||||||
: "Private",
|
: "Private",
|
||||||
desc: k.Channel.Contents.ItemSection.About.Description.replace(/\n/g, " <br> "),
|
desc: d
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue