From 545b80126bf9ea64297a56566423cd3f16b71fb3 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 18 Mar 2016 17:58:43 -0700 Subject: Fix shuffle play mode --- .../main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java | 3 +++ app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 1 - .../daneren2005/dsub/service/DownloadServiceLifecycleSupport.java | 1 + .../github/daneren2005/dsub/util/compat/RemoteControlClientLP.java | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) (limited to 'app/src') diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java index 606c79e6..42b6fce6 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -735,6 +735,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR if(downloadService == null) { return; } + downloadService.clear(); downloadService.setShufflePlayEnabled(true); context.openNowPlaying(); return; @@ -838,6 +839,8 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR if (downloadService == null) { return; } + + downloadService.clear(); downloadService.setShufflePlayEnabled(true); context.openNowPlaying(); } diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java index 47ffa8d9..ae6e46ee 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -574,7 +574,6 @@ public class DownloadService extends Service { public synchronized void setShufflePlayEnabled(boolean enabled) { shufflePlay = enabled; if (shufflePlay) { - clear(); checkDownloads(); } SharedPreferences.Editor editor = Util.getPreferences(this).edit(); diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java index 4989db40..fe75e248 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadServiceLifecycleSupport.java @@ -225,6 +225,7 @@ public class DownloadServiceLifecycleSupport { } editor.commit(); + downloadService.clear(); downloadService.setShufflePlayEnabled(true); } else { downloadService.start(); diff --git a/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java b/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java index 47c77cac..03ada494 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java +++ b/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java @@ -468,6 +468,7 @@ public class RemoteControlClientLP extends RemoteControlClientBase { public void onPlayFromSearch (String query, Bundle extras) { // User just asked to playing something if("".equals(query)) { + downloadService.clear(); downloadService.setShufflePlayEnabled(true); } else { String mediaFocus = extras.getString(MediaStore.EXTRA_MEDIA_FOCUS); @@ -488,6 +489,7 @@ public class RemoteControlClientLP extends RemoteControlClientBase { editor.putString(Constants.PREFERENCES_KEY_SHUFFLE_GENRE, genre); editor.commit(); + downloadService.clear(); downloadService.setShufflePlayEnabled(true); } else { -- cgit v1.2.3