From de40d183a65f1453a14c5bb84359937c7486708c Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Mon, 10 May 2021 14:28:23 +0545 Subject: [PATCH] fix spotify playlist list --- src/Player.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Player.ts b/src/Player.ts index b23647c..e43139e 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -207,7 +207,7 @@ export class Player extends EventEmitter { if (!playlist) return void this.emit(PlayerEvents.NO_RESULTS, message, query); // tslint:disable-next-line:no-shadowed-variable - const tracks = await Promise.all( + let tracks = await Promise.all( playlist.tracks.items.map(async (item: any) => { const sq = queryType === 'spotify_album' @@ -232,7 +232,8 @@ export class Player extends EventEmitter { if (data.length) return data[0]; }) ); - + + tracks = tracks.filter(f => !!f); if (!tracks.length) return void this.emit(PlayerEvents.NO_RESULTS, message, query); const pl = {