fix(Playlist): revert last changes
This commit is contained in:
parent
f806d1bf85
commit
92565b5f5b
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue