From 9bfb05214551150ea69107840a76295f767ec572 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 7 Nov 2012 21:19:16 -0800 Subject: Fixed Play Last not working when nothing is selected --- .../dsub/activity/SelectAlbumActivity.java | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java index 4d94d0a1..591ae9d6 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java @@ -125,14 +125,13 @@ public class SelectAlbumActivity extends SubsonicTabActivity { Intent intent; switch (item.getItemId()) { case R.id.menu_play_now: - playNow(false); + playNow(false, false); return true; case R.id.menu_play_last: - download(true, false, false, false, false); - selectAll(false, false); + playNow(false, true); return true; case R.id.menu_shuffle: - playNow(true); + playNow(true, false); return true; case R.id.menu_select: selectAllOrNone(); @@ -172,16 +171,16 @@ public class SelectAlbumActivity extends SubsonicTabActivity { return false; } - private void playNow(final boolean shuffle) { + private void playNow(final boolean shuffle, final boolean append) { if(getSelectedSongs().size() > 0) { - download(false, false, true, false, shuffle); + download(append, false, !append, false, shuffle); selectAll(false, false); } else { - playAll(shuffle); + playAll(shuffle, append); } } - private void playAll(final boolean shuffle) { + private void playAll(final boolean shuffle, final boolean append) { boolean hasSubFolders = false; for (int i = 0; i < entryList.getCount(); i++) { MusicDirectory.Entry entry = (MusicDirectory.Entry) entryList.getItemAtPosition(i); @@ -193,10 +192,10 @@ public class SelectAlbumActivity extends SubsonicTabActivity { String id = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_ID); if (hasSubFolders && id != null) { - downloadRecursively(id, false, false, true, shuffle, false); + downloadRecursively(id, false, append, !append, shuffle, false); } else { selectAll(true, false); - download(false, false, true, false, shuffle); + download(append, false, !append, false, shuffle); selectAll(false, false); } } @@ -556,7 +555,7 @@ public class SelectAlbumActivity extends SubsonicTabActivity { boolean playAll = getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, false); if (playAll && songCount > 0) { - playAll(getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, false)); + playAll(getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, false), false); } } } -- cgit v1.2.3