Skip to content

Commit

Permalink
chore: add check and remove TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Duell10111 committed Oct 12, 2024
1 parent 0a3f609 commit 51097d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parser/ytmusic/TrackInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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 }
);
Expand Down

0 comments on commit 51097d7

Please sign in to comment.