diff --git a/build-number.txt b/build-number.txt index 7f3589da..d2fc5e3e 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -1651 \ No newline at end of file +1654 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/song/SongLoaderThread.java b/src/main/java/me/chayapak1/chomens_bot/song/SongLoaderThread.java index 4533ca76..1bfcdfb1 100644 --- a/src/main/java/me/chayapak1/chomens_bot/song/SongLoaderThread.java +++ b/src/main/java/me/chayapak1/chomens_bot/song/SongLoaderThread.java @@ -15,8 +15,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; -// Author: _ChipMC_ or hhhzzzsss? also i modified it to use runnable -// because thread = bad !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +// Author: _ChipMC_ & hhhzzzsss public class SongLoaderThread extends Thread { // should the converters be here? public static final List converters = new ArrayList<>(); @@ -81,14 +80,12 @@ public class SongLoaderThread extends Thread { public void run () { if (isFolder && !isUrl && !isItem) { try (Stream files = Files.list(songPath)) { - if (files != null) { - files.forEach((file) -> { - songPath = file; - processFile(); - }); + files.forEach((file) -> { + songPath = file; + processFile(); + }); - showAddedToQueue(); - } + showAddedToQueue(); } catch (IOException e) { bot.logger.error(e); } @@ -126,9 +123,7 @@ public class SongLoaderThread extends Thread { try { song = converter.getSongFromBytes(bytes, name, bot); - } catch (Exception e) { - bot.logger.error(e); - } + } catch (Exception ignored) {} } if (song == null) {