From 005ba9f0bb8b7fcf2d88d113b188251f1110768f Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 21 Sep 2022 14:33:49 +0200 Subject: [PATCH] fix some issues on the channel page --- server.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index 9a77893f..8a5980ad 100644 --- a/server.js +++ b/server.js @@ -431,8 +431,6 @@ app.get("/search", async (req, res) => { 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`); @@ -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, "
") + 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, "
"), + desc: d }); });