From 5386bbc91427bc727986996d7e0215f1930c4c16 Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Mon, 10 May 2021 13:49:30 +0545 Subject: [PATCH] fix spotify track name --- src/Player.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Player.ts b/src/Player.ts index 0676862..8221bb6 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -209,18 +209,19 @@ export class Player extends EventEmitter { // tslint:disable-next-line:no-shadowed-variable const tracks = await Promise.all( playlist.tracks.items.map(async (item: any) => { + const sq = queryType === 'spotify_album' ? `${ this.options.disableArtistSearch ? item.artists[0].name : `${item.artists[0].name} - ` - }${item.name}` + }${item.name ?? item.track.name}` : `${ this.options.disableArtistSearch ? item.track.artists[0].name : `${item.track.artists[0].name} - ` - }${item.name}`; + }${item.name ?? item.track.name}`; const data = await Util.ytSearch(sq, { limit: 1,