From f806d1bf858738ada73421c5a75aab175a7ee137 Mon Sep 17 00:00:00 2001 From: DevAndromeda <46562212+DevAndromeda@users.noreply.github.com> Date: Wed, 11 Aug 2021 11:27:51 +0545 Subject: [PATCH] fix(Playlist): avoid circular calls --- src/Structures/Playlist.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Structures/Playlist.ts b/src/Structures/Playlist.ts index d76dd66..7ab093d 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 = true) { + toJSON(withTracks = false) { 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(true)); + if (withTracks) payload.tracks = this.tracks.map((m) => m.toJSON(false)); return payload as PlaylistJSON; }