Skip to content

Commit

Permalink
fix double blocking of cf
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jan 27, 2022
1 parent 3149319 commit f2ea09d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public AudioSourceManager getSourceManager(){
return this.spotifySourceManager;
}

public AudioItem loadItem(String query) throws ExecutionException, InterruptedException{
public AudioItem loadItem(String query) {
var cf = new CompletableFuture<AudioItem>();
this.spotifySourceManager.getAudioPlayerManager().loadItem(query, new AudioLoadResultHandler(){

Expand All @@ -141,8 +141,7 @@ public void loadFailed(FriendlyException exception){
cf.completeExceptionally(exception);
}
});
cf.join();
return cf.get();
return cf.join();
}

@Override
Expand Down

0 comments on commit f2ea09d

Please sign in to comment.