refactor!: fix inconsistent use of SuperParsedResult

This commit is contained in:
LuanRT
2022-08-07 06:15:55 -03:00
parent 709c448053
commit 40fc24b043
11 changed files with 84 additions and 78 deletions

View File

@@ -10,7 +10,7 @@ class Author {
this.#nav_text = new NavigatableText(item);
this.id =
this.#nav_text.runs?.[0].endpoint.browse?.id ||
this.#nav_text.runs?.[0].endpoint?.browse?.id ||
this.#nav_text.endpoint?.browse?.id || 'N/A';
this.name = this.#nav_text.text || 'N/A';
@@ -21,8 +21,8 @@ class Author {
this.is_verified_artist = this.badges?.some((badge) => badge.style == 'BADGE_STYLE_TYPE_VERIFIED_ARTIST') || null;
this.url =
this.#nav_text.runs?.[0].endpoint.browse &&
`${Constants.URLS.YT_BASE}${this.#nav_text.runs[0].endpoint.browse?.base_url || `/u/${this.#nav_text.runs[0].endpoint.browse?.id}`}` ||
this.#nav_text.runs?.[0].endpoint?.browse &&
`${Constants.URLS.YT_BASE}${this.#nav_text.runs[0].endpoint?.browse?.base_url || `/u/${this.#nav_text.runs[0].endpoint?.browse?.id}`}` ||
`${Constants.URLS.YT_BASE}${this.#nav_text.endpoint?.browse?.base_url || `/u/${this.#nav_text.endpoint?.browse?.id}`}` ||
null;
}