This commit is contained in:
Snowflake107 2021-05-10 13:56:03 +05:45
parent 5386bbc914
commit 4d0fa222b2
2 changed files with 28 additions and 29 deletions

View file

@ -209,14 +209,13 @@ export class Player extends EventEmitter {
// tslint:disable-next-line:no-shadowed-variable // tslint:disable-next-line:no-shadowed-variable
const tracks = await Promise.all<Track>( const tracks = await Promise.all<Track>(
playlist.tracks.items.map(async (item: any) => { playlist.tracks.items.map(async (item: any) => {
const sq = const sq =
queryType === 'spotify_album' queryType === 'spotify_album'
? `${ ? `${
this.options.disableArtistSearch this.options.disableArtistSearch
? item.artists[0].name ? item.artists[0].name
: `${item.artists[0].name} - ` : `${item.artists[0].name} - `
}${item.name ?? item.track.name}` }${item.name ?? item.track.name}`
: `${ : `${
this.options.disableArtistSearch this.options.disableArtistSearch
? item.track.artists[0].name ? item.track.artists[0].name

View file

@ -1,33 +1,33 @@
import { PlayerOptions as DP_OPTIONS } from '../types/types'; import { PlayerOptions as DP_OPTIONS } from '../types/types';
export const PlayerEvents = { export enum PlayerEvents {
BOT_DISCONNECT: 'botDisconnect', BOT_DISCONNECT = 'botDisconnect',
CHANNEL_EMPTY: 'channelEmpty', CHANNEL_EMPTY = 'channelEmpty',
CONNECTION_CREATE: 'connectionCreate', CONNECTION_CREATE = 'connectionCreate',
ERROR: 'error', ERROR = 'error',
MUSIC_STOP: 'musicStop', MUSIC_STOP = 'musicStop',
NO_RESULTS: 'noResults', NO_RESULTS = 'noResults',
PLAYLIST_ADD: 'playlistAdd', PLAYLIST_ADD = 'playlistAdd',
PLAYLIST_PARSE_END: 'playlistParseEnd', PLAYLIST_PARSE_END = 'playlistParseEnd',
PLAYLIST_PARSE_START: 'playlistParseStart', PLAYLIST_PARSE_START = 'playlistParseStart',
QUEUE_CREATE: 'queueCreate', QUEUE_CREATE = 'queueCreate',
QUEUE_END: 'queueEnd', QUEUE_END = 'queueEnd',
SEARCH_CANCEL: 'searchCancel', SEARCH_CANCEL = 'searchCancel',
SEARCH_INVALID_RESPONSE: 'searchInvalidResponse', SEARCH_INVALID_RESPONSE = 'searchInvalidResponse',
SEARCH_RESULTS: 'searchResults', SEARCH_RESULTS = 'searchResults',
TRACK_ADD: 'trackAdd', TRACK_ADD = 'trackAdd',
TRACK_START: 'trackStart' TRACK_START = 'trackStart'
}; }
export const PlayerErrorEventCodes = { export enum PlayerErrorEventCodes {
LIVE_VIDEO: 'LiveVideo', LIVE_VIDEO = 'LiveVideo',
NOT_CONNECTED: 'NotConnected', NOT_CONNECTED = 'NotConnected',
UNABLE_TO_JOIN: 'UnableToJoin', UNABLE_TO_JOIN = 'UnableToJoin',
NOT_PLAYING: 'NotPlaying', NOT_PLAYING = 'NotPlaying',
PARSE_ERROR: 'ParseError', PARSE_ERROR = 'ParseError',
VIDEO_UNAVAILABLE: 'VideoUnavailable', VIDEO_UNAVAILABLE = 'VideoUnavailable',
MUSIC_STARTING: 'MusicStarting' MUSIC_STARTING = 'MusicStarting'
}; }
export const PlayerOptions: DP_OPTIONS = { export const PlayerOptions: DP_OPTIONS = {
leaveOnEnd: true, leaveOnEnd: true,