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

@@ -44,7 +44,10 @@ class Library {
this.profile = { stats, user_info };
const shelves = tab.content.item().as(SectionList).contents.array().as(ItemSection).map((is: ItemSection) => is.contents?.firstOfType(Shelf));
if (!tab.content)
throw new InnertubeError('Target tab did not have any content.');
const shelves = tab.content.as(SectionList).contents.array().as(ItemSection).map((is: ItemSection) => is.contents?.firstOfType(Shelf));
this.sections = shelves.map((shelf: any) => ({
type: shelf.icon_type,