From 92565b5f5bff60684b57a60505bc990e61ca0c2e Mon Sep 17 00:00:00 2001 From: DevAndromeda <46562212+DevAndromeda@users.noreply.github.com> Date: Wed, 11 Aug 2021 11:29:36 +0545 Subject: [PATCH] fix(Playlist): revert last changes --- src/Structures/Playlist.ts | 4 ++-- src/Structures/Track.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Structures/Playlist.ts b/src/Structures/Playlist.ts index 7ab093d..d76dd66 100644 --- a/src/Structures/Playlist.ts +++ b/src/Structures/Playlist.ts @@ -116,7 +116,7 @@ class Playlist { * @param {boolean} [withTracks=true] If it should build json with tracks * @returns {PlaylistJSON} */ - toJSON(withTracks = false) { + toJSON(withTracks = true) { const payload = { id: this.id, url: this.url, @@ -129,7 +129,7 @@ class Playlist { tracks: [] as TrackJSON[] }; - if (withTracks) payload.tracks = this.tracks.map((m) => m.toJSON(false)); + if (withTracks) payload.tracks = this.tracks.map((m) => m.toJSON(true)); return payload as PlaylistJSON; } diff --git a/src/Structures/Track.ts b/src/Structures/Track.ts index 456de2b..7504e55 100644 --- a/src/Structures/Track.ts +++ b/src/Structures/Track.ts @@ -174,7 +174,7 @@ class Track { durationMS: this.durationMS, views: this.views, requestedBy: this.requestedBy.id, - playlist: hidePlaylist ? null : this.playlist?.toJSON(false) ?? null + playlist: hidePlaylist ? null : this.playlist?.toJSON() ?? null } as TrackJSON; } }