mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-17 05:54:42 -05:00
optimize code owo
This commit is contained in:
parent
654a0c81f6
commit
194764ba03
1 changed files with 1 additions and 13 deletions
|
@ -99,18 +99,6 @@ class PokeTubeCore {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.checkUnexistingObject(vid)) {
|
if (this.checkUnexistingObject(vid)) {
|
||||||
let a;
|
|
||||||
|
|
||||||
try {
|
|
||||||
a = await fetch(`${this.config.tubeApi}channel?id=${vid.authorId}&tab=about`)
|
|
||||||
.then((res) => res.text())
|
|
||||||
.then((xml) => this.getJson(toJson(xml)));
|
|
||||||
} catch (error) {
|
|
||||||
this.initError("Error getting channel info", error);
|
|
||||||
a = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
desc = a.Channel?.Contents?.ItemSection?.About?.Description;
|
|
||||||
const fe = await fetcher(v);
|
const fe = await fetcher(v);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -137,7 +125,7 @@ class PokeTubeCore {
|
||||||
comments,
|
comments,
|
||||||
engagement: fe.engagement,
|
engagement: fe.engagement,
|
||||||
wiki: summary,
|
wiki: summary,
|
||||||
desc: desc,
|
desc: "",
|
||||||
color: await getColors(
|
color: await getColors(
|
||||||
`https://i.ytimg.com/vi/${v}/hqdefault.jpg?sqp=${this.sqp}`
|
`https://i.ytimg.com/vi/${v}/hqdefault.jpg?sqp=${this.sqp}`
|
||||||
).then((colors) => colors[0].hex()),
|
).then((colors) => colors[0].hex()),
|
||||||
|
|
Loading…
Reference in a new issue