diff --git a/src/main/java/moe/nekojimi/chords/MusicHandler.java b/src/main/java/moe/nekojimi/chords/MusicHandler.java index 62bde01..b0b6dc4 100644 --- a/src/main/java/moe/nekojimi/chords/MusicHandler.java +++ b/src/main/java/moe/nekojimi/chords/MusicHandler.java @@ -95,7 +95,8 @@ public class MusicHandler implements AudioSendHandler, Closeable, Consumer } if (currentSong != null) { - currentSong.delete(); + if (!currentSong.isKept()) + currentSong.delete(); currentSong = null; } currentSong = songQueue.poll(); diff --git a/src/main/java/moe/nekojimi/chords/Song.java b/src/main/java/moe/nekojimi/chords/Song.java index 2a9557d..0cf134c 100644 --- a/src/main/java/moe/nekojimi/chords/Song.java +++ b/src/main/java/moe/nekojimi/chords/Song.java @@ -22,6 +22,7 @@ public class Song private String requestedBy; private String requestedIn; + private boolean kept = false; public Song(URL url) { @@ -100,6 +101,16 @@ public class Song this.requestedIn = requestedIn; } + public boolean isKept() + { + return kept; + } + + public void setKept(boolean kept) + { + this.kept = kept; + } + @Override public String toString() {