Skip to content

Commit

Permalink
AA voice search improvements
Browse files Browse the repository at this point in the history
Specific song requests weren't doing anything, and requests to 'play
some (artist)' would queue up albums in chronological order.

Single songs now working, and artist requests will shuffle which is in
line with other services like spotify etc.
  • Loading branch information
glennguy committed Sep 8, 2018
1 parent c29e529 commit 6eb8fcb
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ protected Void doInBackground(MusicService musicService) throws Throwable {
SearchResult results = musicService.search(searchCritera, downloadService, null);

if(results.hasArtists()) {
playFromParent(new Entry(results.getArtists().get(0)));
playFromParent(new Entry(results.getArtists().get(0)), true);
} else if(results.hasAlbums()) {
playFromParent(results.getAlbums().get(0));
playFromParent(results.getAlbums().get(0), false);
} else if(results.hasSongs()) {
playSong(results.getSongs().get(0));
} else {
Expand All @@ -327,10 +327,10 @@ protected Void doInBackground(MusicService musicService) throws Throwable {
return null;
}

private void playFromParent(Entry parent) throws Exception {
private void playFromParent(Entry parent, boolean shuffle) throws Exception {
List<Entry> songs = new ArrayList<>();
getSongsRecursively(parent, songs);
playSongs(songs);
playSongs(songs, shuffle, false, false);
}
private void getSongsRecursively(Entry parent, List<Entry> songs) throws Exception {
MusicDirectory musicDirectory;
Expand Down Expand Up @@ -421,7 +421,7 @@ protected Void doInBackground(MusicService musicService) throws Throwable {
}

private void playSong(Entry entry) {

playSong(entry, false);
}
private void playSong(Entry entry, boolean resumeFromBookmark) {
List<Entry> entries = new ArrayList<>();
Expand Down

0 comments on commit 6eb8fcb

Please sign in to comment.