From 282231d55b4ca3edd210f36aa9f0eb0cc69e0414 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 25 Aug 2014 20:23:33 -0700 Subject: Fix web commit --- src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/github') diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 8a9a0f0b..45135fa9 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -783,6 +783,8 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR protected void downloadRecursively(final String id, final String name, final boolean isDirectory, final boolean save, final boolean append, final boolean autoplay, final boolean shuffle, final boolean background, final boolean playNext) { LoadingTask task = new LoadingTask(context) { private static final int MAX_SONGS = 500; + private boolean playNowOverride = false; + private List songs; @Override protected Boolean doInBackground() throws Throwable { @@ -806,7 +808,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR Collections.shuffle(root.getChildren()); } - List songs = new LinkedList(); + songs = new LinkedList(); getSongsRecursively(root, songs); DownloadService downloadService = getDownloadService(); @@ -814,8 +816,8 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR if (!songs.isEmpty() && downloadService != null) { // Conditions for a standard play now operation if(!append && !save && autoplay && !playNext && !shuffle && !background) { - playNow(songs); - return; + playNowOverride = true; + return false; } if (!append) { @@ -861,6 +863,11 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR @Override protected void done(Boolean result) { + if(playNowOverride) { + playNow(songs); + return; + } + warnIfNetworkOrStorageUnavailable(); if(result) { -- cgit v1.2.3