refactor: remove debug song loading error logging in SongLoaderThread & some minor refactors with the comments

This commit is contained in:
ChomeNS
2025-03-02 15:38:12 +07:00
parent 04c7c64c9e
commit f3ffa19bfa
2 changed files with 8 additions and 13 deletions

View File

@@ -1 +1 @@
1651
1654

View File

@@ -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<Converter> converters = new ArrayList<>();
@@ -81,14 +80,12 @@ public class SongLoaderThread extends Thread {
public void run () {
if (isFolder && !isUrl && !isItem) {
try (Stream<Path> 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) {