From 6c3d66069c1f0e84473aac11a64cf745a31eab1a Mon Sep 17 00:00:00 2001 From: Nekojimi Date: Wed, 18 May 2022 20:57:51 +0100 Subject: [PATCH] Properly clear presence message when the queue runs dry. --- src/main/java/moe/nekojimi/chords/MusicHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/moe/nekojimi/chords/MusicHandler.java b/src/main/java/moe/nekojimi/chords/MusicHandler.java index 16a5627..8ba294f 100644 --- a/src/main/java/moe/nekojimi/chords/MusicHandler.java +++ b/src/main/java/moe/nekojimi/chords/MusicHandler.java @@ -106,11 +106,11 @@ public class MusicHandler implements AudioSendHandler, Closeable, Consumer currentSong = null; } currentSong = songQueue.poll(); + if (nowPlayingConsumer != null) + nowPlayingConsumer.accept(currentSong); if (currentSong == null) return false; System.out.println("Playing song " + currentSong.getLocation().getAbsolutePath()); - if (nowPlayingConsumer != null) - nowPlayingConsumer.accept(currentSong); arrayErr = false; in = AudioSystem.getAudioInputStream(currentSong.getLocation()); AudioFormat decodedFormat = AudioSendHandler.INPUT_FORMAT;