From 3a09c172480c30f635f84e3bb3f084b896893591 Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Sun, 9 May 2021 18:09:20 +0545 Subject: [PATCH] formatting --- src/Player.ts | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Player.ts b/src/Player.ts index 8cc97ad..1c55cc5 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -177,27 +177,29 @@ export class Player extends EventEmitter { } break; - case 'spotify_album': - case 'spotify_playlist': { - this.emit(PlayerEvents.PLAYLIST_PARSE_START, null, message); - const playlist = await spotify.getData(query); - if (!playlist) return void this.emit(PlayerEvents.NO_RESULTS, message, query); + case 'spotify_album': + case 'spotify_playlist': { + this.emit(PlayerEvents.PLAYLIST_PARSE_START, null, message); + const playlist = await spotify.getData(query); + if (!playlist) return void this.emit(PlayerEvents.NO_RESULTS, message, query); - const tracks = await Promise.all(playlist.tracks.items.map(async (item: any) => { - const sq = - queryType === 'spotify_album' - ? `${item.artists[0].name} - ${item.name}` - : `${item.track.artists[0].name} - ${item.name}`; + const tracks = await Promise.all( + playlist.tracks.items.map(async (item: any) => { + const sq = + queryType === 'spotify_album' + ? `${item.artists[0].name} - ${item.name}` + : `${item.track.artists[0].name} - ${item.name}`; - const data = await Util.ytSearch(sq, { - limit: 1, - player: this, - user: message.author, - pl: true - }); + const data = await Util.ytSearch(sq, { + limit: 1, + player: this, + user: message.author, + pl: true + }); - return data[0]; - })); + return data[0]; + }) + ); if (!tracks.length) return void this.emit(PlayerEvents.NO_RESULTS, message, query);