mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-01 10:07:24 +01:00
fix some issues on the channel page
This commit is contained in:
parent
e0bcf41f15
commit
61ca5e12ef
1 changed files with 9 additions and 3 deletions
12
server.js
12
server.js
|
@ -432,8 +432,6 @@ app.get("/channel/", async (req, res) => {
|
|||
const ID = req.query.id;
|
||||
const tab = req.query.tab;
|
||||
|
||||
|
||||
|
||||
// about
|
||||
const bout = await fetch(config.tubeApi + `channel?id=${ID}&tab=about`);
|
||||
const h = await bout.text();
|
||||
|
@ -455,18 +453,26 @@ app.get("/channel/", async (req, res) => {
|
|||
}
|
||||
|
||||
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", {
|
||||
ID: ID,
|
||||
tab: tab,
|
||||
j: k,
|
||||
tj: tj,
|
||||
wiki: w,
|
||||
isMobile: req.useragent.isMobile,
|
||||
about: k.Channel.Contents.ItemSection.About,
|
||||
subs:
|
||||
typeof subscribers === "string"
|
||||
? subscribers.replace("subscribers", "")
|
||||
: "Private",
|
||||
desc: k.Channel.Contents.ItemSection.About.Description.replace(/\n/g, " <br> "),
|
||||
desc: d
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue