diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java index 9f253c8..f6d02df 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java @@ -408,7 +408,7 @@ public class MusicCommand extends Command { if (currentSong == null) return Component.text("No song is currently playing").color(NamedTextColor.RED); // ig very code yup - final String title = currentSong.name; + final String title = currentSong.originalName; final String songAuthor = currentSong.songAuthor == null || currentSong.songAuthor.equals("") ? "N/A" : currentSong.songAuthor; final String songOriginalAuthor = currentSong.songOriginalAuthor == null || currentSong.songOriginalAuthor.equals("") ? "N/A" : currentSong.songOriginalAuthor; final String songDescription = currentSong.songDescription == null || currentSong.songDescription.equals("") ? "N/A" : currentSong.songDescription; diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Song.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Song.java index 93cf486..512b4cc 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Song.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Song.java @@ -8,6 +8,7 @@ import java.util.Collections; // Author: hhhzzzsss & _ChipMC_ but i changed most of the stuff public class Song { public final ArrayList notes = new ArrayList<>(); + public final String originalName; public final String name; public int position = 0; // Current note index public boolean paused = true; @@ -26,9 +27,32 @@ public class Song { // public int loopCount = 0; // Number of times to loop // public int currentLoop = 0; // Number of loops so far - private Bot bot; + private final Bot bot; - public Song (String name, Bot bot, String songName, String songAuthor, String songOriginalAuthor, String songDescription, boolean nbs) { + public Song (String originalName, Bot bot, String songName, String songAuthor, String songOriginalAuthor, String songDescription, boolean nbs) { + String name = ""; + + // real ohio code + // TODO: clean this up + if (isNotNullAndNotBlank(songOriginalAuthor) && !isNotNullAndNotBlank(songAuthor)) name = String.format( + "%s - %s", + songOriginalAuthor, + originalName + ); + else if (!isNotNullAndNotBlank(songOriginalAuthor) && isNotNullAndNotBlank(songAuthor)) name = String.format( + "%s - %s", + songAuthor, + originalName + ); + else if (isNotNullAndNotBlank(songOriginalAuthor) && isNotNullAndNotBlank(songAuthor)) name = String.format( + "%s/%s - %s", + songOriginalAuthor, + songAuthor, + originalName + ); + else name = originalName; + + this.originalName = originalName; this.name = name; this.bot = bot; this.songName = songName; @@ -38,6 +62,11 @@ public class Song { this.nbs = nbs; } + // should this be in idk, util? + private boolean isNotNullAndNotBlank (String text) { + return text != null && !text.isBlank(); + } + public Note get (int i) { return notes.get(i); }