fix formatting and nulls in metadata
This commit is contained in:
@@ -37,13 +37,13 @@ public class QueuedTrack implements Queueable
|
|||||||
public QueuedTrack(AudioTrack track, RequestMetadata rm)
|
public QueuedTrack(AudioTrack track, RequestMetadata rm)
|
||||||
{
|
{
|
||||||
this.track = track;
|
this.track = track;
|
||||||
this.track.setUserData(rm);
|
this.track.setUserData(rm == null ? RequestMetadata.EMPTY : rm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getIdentifier()
|
public long getIdentifier()
|
||||||
{
|
{
|
||||||
return track.getUserData(RequestMetadata.class).getOwner();
|
return track.getUserData() == null ? 0L : track.getUserData(RequestMetadata.class).getOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AudioTrack getTrack()
|
public AudioTrack getTrack()
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ import java.util.Set;
|
|||||||
* @author John Grosh (jagrosh)
|
* @author John Grosh (jagrosh)
|
||||||
* @param <T>
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
public class FairQueue<T extends Queueable> {
|
public class FairQueue<T extends Queueable>
|
||||||
|
{
|
||||||
private final List<T> list = new ArrayList<>();
|
private final List<T> list = new ArrayList<>();
|
||||||
private final Set<Long> set = new HashSet<>();
|
private final Set<Long> set = new HashSet<>();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user