Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AA voice search improvements #883

Merged
merged 1 commit into from
Sep 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 Oh man I really had a blank function there? Good catch

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