fix false comare

This commit is contained in:
KGT1 2021-01-18 07:02:50 +01:00
parent f75b978dd8
commit 0db64a3ee2

View File

@ -31,7 +31,7 @@ function streamURLbuilder (itemID, bitrate) {
} }
function startPlaying (voiceconnection = discordclientmanager.getDiscordClient().user.client.voice.connections.first(), itemIDPlaylist = currentPlayingPlaylist, playlistIndex = currentPlayingPlaylistIndex, seekTo, disconnectOnFinish = _disconnectOnFinish) { function startPlaying (voiceconnection = discordclientmanager.getDiscordClient().user.client.voice.connections.first(), itemIDPlaylist = currentPlayingPlaylist, playlistIndex = currentPlayingPlaylistIndex, seekTo, disconnectOnFinish = _disconnectOnFinish) {
log.debug("start playing ",playlistIndex, ". of list: ",itemIDPlaylist," in a voiceconnection?: ", voiceconnection=!undefined); log.debug("start playing ",playlistIndex, ". of list: ",itemIDPlaylist," in a voiceconnection?: ", isNaN(voiceconnection));
isPaused = false; isPaused = false;
currentPlayingPlaylist = itemIDPlaylist; currentPlayingPlaylist = itemIDPlaylist;
currentPlayingPlaylistIndex = playlistIndex; currentPlayingPlaylistIndex = playlistIndex;
@ -159,7 +159,7 @@ function previousTrack () {
* @param {Object=} disconnectVoiceConnection - Optional The voice Connection do disconnect from * @param {Object=} disconnectVoiceConnection - Optional The voice Connection do disconnect from
*/ */
function stop (disconnectVoiceConnection, itemId = getItemId()) { function stop (disconnectVoiceConnection, itemId = getItemId()) {
log.debug("stop playback and send following payload to the server: ",getStopPayload());
isPaused = true; isPaused = true;
if (interactivemsghandler.hasMessage()) { if (interactivemsghandler.hasMessage()) {
interactivemsghandler.destroy(); interactivemsghandler.destroy();
@ -167,6 +167,7 @@ function stop (disconnectVoiceConnection, itemId = getItemId()) {
if (disconnectVoiceConnection) { if (disconnectVoiceConnection) {
disconnectVoiceConnection.disconnect(); disconnectVoiceConnection.disconnect();
} }
log.debug("stop playback and send following payload to the server: ",getStopPayload());
jellyfinClientManager.getJellyfinClient().reportPlaybackStopped(getStopPayload()); jellyfinClientManager.getJellyfinClient().reportPlaybackStopped(getStopPayload());
if (getAudioDispatcher()) { if (getAudioDispatcher()) {
try { try {