From 82ac920ce7b6f59407c1cdc27f36db923d82e712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Spa=CC=88th?= Date: Sun, 29 Sep 2024 21:06:44 +0200 Subject: [PATCH] chore: add check and remove TODO --- src/parser/ytmusic/TrackInfo.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parser/ytmusic/TrackInfo.ts b/src/parser/ytmusic/TrackInfo.ts index 4e20a26c9..fd35391d5 100644 --- a/src/parser/ytmusic/TrackInfo.ts +++ b/src/parser/ytmusic/TrackInfo.ts @@ -92,8 +92,6 @@ class TrackInfo extends MediaInfo { client: 'YTMUSIC', parse: true }); - - // TODO: Use continuation to extend playlist list if (!page || !page.contents_memo) throw new InnertubeError('Could not fetch automix'); @@ -111,6 +109,10 @@ class TrackInfo extends MediaInfo { if (!this.current_video_endpoint) throw new InnertubeError('Current Video Endpoint was not defined.', this.current_video_endpoint); + if (playlistPanel instanceof PlaylistPanel && playlistPanel.playlist_id !== this.current_video_endpoint.payload.playlistId) { + throw new InnertubeError('PlaylistId from TrackInfo does not match with PlaylistPanel'); + } + const response = await this.actions.execute( NextEndpoint.PATH, { ...NextEndpoint.build({ ...this.current_video_endpoint.payload, client: 'YTMUSIC', continuation: playlistPanel.continuation }), parse: true } );