nbs author and original author in the name
This commit is contained in:
parent
27e5909697
commit
7f99a31cbd
2 changed files with 32 additions and 3 deletions
|
@ -408,7 +408,7 @@ public class MusicCommand extends Command {
|
||||||
if (currentSong == null) return Component.text("No song is currently playing").color(NamedTextColor.RED);
|
if (currentSong == null) return Component.text("No song is currently playing").color(NamedTextColor.RED);
|
||||||
|
|
||||||
// ig very code yup
|
// 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 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 songOriginalAuthor = currentSong.songOriginalAuthor == null || currentSong.songOriginalAuthor.equals("") ? "N/A" : currentSong.songOriginalAuthor;
|
||||||
final String songDescription = currentSong.songDescription == null || currentSong.songDescription.equals("") ? "N/A" : currentSong.songDescription;
|
final String songDescription = currentSong.songDescription == null || currentSong.songDescription.equals("") ? "N/A" : currentSong.songDescription;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Collections;
|
||||||
// Author: hhhzzzsss & _ChipMC_ but i changed most of the stuff
|
// Author: hhhzzzsss & _ChipMC_ but i changed most of the stuff
|
||||||
public class Song {
|
public class Song {
|
||||||
public final ArrayList<Note> notes = new ArrayList<>();
|
public final ArrayList<Note> notes = new ArrayList<>();
|
||||||
|
public final String originalName;
|
||||||
public final String name;
|
public final String name;
|
||||||
public int position = 0; // Current note index
|
public int position = 0; // Current note index
|
||||||
public boolean paused = true;
|
public boolean paused = true;
|
||||||
|
@ -26,9 +27,32 @@ public class Song {
|
||||||
// public int loopCount = 0; // Number of times to loop
|
// public int loopCount = 0; // Number of times to loop
|
||||||
// public int currentLoop = 0; // Number of loops so far
|
// 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.name = name;
|
||||||
this.bot = bot;
|
this.bot = bot;
|
||||||
this.songName = songName;
|
this.songName = songName;
|
||||||
|
@ -38,6 +62,11 @@ public class Song {
|
||||||
this.nbs = nbs;
|
this.nbs = nbs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// should this be in idk, util?
|
||||||
|
private boolean isNotNullAndNotBlank (String text) {
|
||||||
|
return text != null && !text.isBlank();
|
||||||
|
}
|
||||||
|
|
||||||
public Note get (int i) {
|
public Note get (int i) {
|
||||||
return notes.get(i);
|
return notes.get(i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue