From 43acfe3352c4863f854be5493830fdc5ec933ae6 Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 14 Nov 2022 18:37:20 +0100 Subject: [PATCH] refactor code :3 --- src/libpoketube/libpoketube-core.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libpoketube/libpoketube-core.js b/src/libpoketube/libpoketube-core.js index 1c25ee8e..42f355dd 100644 --- a/src/libpoketube/libpoketube-core.js +++ b/src/libpoketube/libpoketube-core.js @@ -86,6 +86,9 @@ async function video(v) { summary_.title !== "Not found." ? summary_ : "none" ); + const desc = a.Channel?.Contents.ItemSection.About.Description; + + const data = await fetcher(v); const nightlyJsonData = getJson(nightlyRes); @@ -96,7 +99,7 @@ async function video(v) { comments, engagement: data.engagement, wiki: summary, - desc: a.Channel.Contents.ItemSection.About.Description, + desc: desc, color: await getColors( `https://i.ytimg.com/vi/${v}/maxresdefault.jpg` ).then((colors) => colors[0].hex()),