From 1ec2ea85e2f0db4ba65c71716075b7dab432942f Mon Sep 17 00:00:00 2001 From: LuanRT Date: Fri, 19 Apr 2024 16:22:21 -0300 Subject: [PATCH] refactor(Music#getRelated): Return page contents directy --- src/core/clients/Music.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/clients/Music.ts b/src/core/clients/Music.ts index 9820bf9f..08dbac42 100644 --- a/src/core/clients/Music.ts +++ b/src/core/clients/Music.ts @@ -278,7 +278,7 @@ export default class Music { * Retrieves related content. * @param video_id - The video id. */ - async getRelated(video_id: string): Promise> { + async getRelated(video_id: string): Promise { throwIfMissing({ video_id }); const response = await this.#actions.execute( @@ -297,9 +297,9 @@ export default class Music { if (!page.contents) throw new InnertubeError('Unexpected response', page); - const shelves = page.contents.item().as(SectionList).contents.as(MusicCarouselShelf, MusicDescriptionShelf); + const contents = page.contents.item().as(SectionList, Message); - return shelves; + return contents; } /**