playlist load faster and queue command shows np

This commit is contained in:
John Grosh
2017-07-04 01:41:42 -04:00
parent 8f7e53a37c
commit cb9644d694
11 changed files with 217 additions and 176 deletions

View File

@@ -48,17 +48,11 @@ public class FormatUtil {
{
if(handler==null)
return "No music playing\n\u23F9 "+progressBar(-1)+" "+volumeIcon(100);
else if (handler.getCurrentTrack()==null)
else if (!handler.isMusicPlaying())
return "No music playing\n\u23F9 "+progressBar(-1)+" "+volumeIcon(handler.getPlayer().getVolume());
else
{
String userid = handler.getCurrentTrack().getIdentifier();
User user;
try {
user = jda.getUserById(userid);
} catch(Exception e) {
user = null;
}
AudioTrack track = handler.getCurrentTrack().getTrack();
String title = track.getInfo().title;
if(!NO_PROGRESS_BAR_IN_TOPIC && title.length()>30)
@@ -73,6 +67,13 @@ public class FormatUtil {
}
}
public static String embedformattedAudio(AudioHandler ah)
{
return (ah.getPlayer().isPaused()?"\u23F8":"\u25B6")+" "+progressBar((double)ah.getCurrentTrack().getTrack().getPosition()/ah.getCurrentTrack().getTrack().getDuration())
+" `["+formatTime(ah.getCurrentTrack().getTrack().getPosition()) + "/" + formatTime(ah.getCurrentTrack().getTrack().getDuration()) +"]` "
+volumeIcon(ah.getPlayer().getVolume());
}
public static String progressBar(double percent)
{
String str = "";