Skip to content

Commit

Permalink
SearchCommand: consider "select" argument when searching Spotify tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
robinfriedli committed Sep 10, 2019
1 parent a509198 commit 28d491f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ private void searchSpotifyTrack() throws Exception {
throw new InvalidCommandException("No search term entered");
}

Callable<List<Track>> loadTrackCallable = () -> getSpotifyService().searchTrack(getCommandInput(), argumentSet("own"));
int limit = argumentSet("select") ? getArgumentValue("select", Integer.class, 20) : 20;
Callable<List<Track>> loadTrackCallable = () -> getSpotifyService().searchTrack(getCommandInput(), argumentSet("own"), limit);
List<Track> found;
if (argumentSet("own")) {
found = runWithLogin(loadTrackCallable);
Expand Down

0 comments on commit 28d491f

Please sign in to comment.