Fix Play Next

This commit is contained in:
Joshua Bahnsen 2013-05-17 11:48:22 -07:00
parent 346ed1ff28
commit cb874bd029
6 changed files with 23 additions and 23 deletions

View File

@ -2,8 +2,8 @@
<manifest xmlns:a="http://schemas.android.com/apk/res/android" <manifest xmlns:a="http://schemas.android.com/apk/res/android"
package="com.thejoshwa.ultrasonic.androidapp" package="com.thejoshwa.ultrasonic.androidapp"
a:installLocation="auto" a:installLocation="auto"
a:versionCode="19" a:versionCode="20"
a:versionName="1.1.0.15" > a:versionName="1.1.0.16" >
<uses-permission a:name="android.permission.INTERNET" /> <uses-permission a:name="android.permission.INTERNET" />
<uses-permission a:name="android.permission.READ_PHONE_STATE" /> <uses-permission a:name="android.permission.READ_PHONE_STATE" />

View File

@ -190,16 +190,16 @@ public class SearchActivity extends SubsonicTabActivity {
switch (menuItem.getItemId()) { switch (menuItem.getItemId()) {
case R.id.album_menu_play_now: case R.id.album_menu_play_now:
downloadRecursively(id, false, false, true, false, false); downloadRecursively(id, false, false, true, false, false, false);
break; break;
case R.id.album_menu_play_next: case R.id.album_menu_play_next:
downloadRecursively(id, false, true, false, true, false); downloadRecursively(id, false, true, false, true, false, true);
break; break;
case R.id.album_menu_play_last: case R.id.album_menu_play_last:
downloadRecursively(id, false, true, false, false, false); downloadRecursively(id, false, true, false, false, false, false);
break; break;
case R.id.album_menu_pin: case R.id.album_menu_pin:
downloadRecursively(id, true, true, false, false, false); downloadRecursively(id, true, true, false, false, false, false);
break; break;
default: default:
return super.onContextItemSelected(menuItem); return super.onContextItemSelected(menuItem);

View File

@ -260,7 +260,7 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
String id = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_ID); String id = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_ID);
if (hasSubFolders && id != null) { if (hasSubFolders && id != null) {
downloadRecursively(id, false, append, !append, shuffle, false); downloadRecursively(id, false, append, !append, shuffle, false, false);
} else { } else {
selectAll(true, false); selectAll(true, false);
download(append, false, !append, false, shuffle); download(append, false, !append, false, shuffle);
@ -296,16 +296,16 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
songs.add((MusicDirectory.Entry) albumListView.getItemAtPosition(info.position)); songs.add((MusicDirectory.Entry) albumListView.getItemAtPosition(info.position));
switch (menuItem.getItemId()) { switch (menuItem.getItemId()) {
case R.id.album_menu_play_now: case R.id.album_menu_play_now:
downloadRecursively(entry.getId(), false, false, true, false, false); downloadRecursively(entry.getId(), false, false, true, false, false, false);
break; break;
case R.id.album_menu_play_next: case R.id.album_menu_play_next:
downloadRecursively(entry.getId(), false, false, true, true, false); downloadRecursively(entry.getId(), false, false, true, true, false, true);
break; break;
case R.id.album_menu_play_last: case R.id.album_menu_play_last:
downloadRecursively(entry.getId(), false, true, false, false, false); downloadRecursively(entry.getId(), false, true, false, false, false, false);
break; break;
case R.id.album_menu_pin: case R.id.album_menu_pin:
downloadRecursively(entry.getId(), true, true, false, false, false); downloadRecursively(entry.getId(), true, true, false, false, false, false);
break; break;
case R.id.select_album_play_all: case R.id.select_album_play_all:
playAll(); playAll();

View File

@ -214,16 +214,16 @@ public class SelectArtistActivity extends SubsonicTabActivity implements Adapter
if (artist != null) { if (artist != null) {
switch (menuItem.getItemId()) { switch (menuItem.getItemId()) {
case R.id.artist_menu_play_now: case R.id.artist_menu_play_now:
downloadRecursively(artist.getId(), false, false, true, false, false); downloadRecursively(artist.getId(), false, false, true, false, false, false);
break; break;
case R.id.artist_menu_play_next: case R.id.artist_menu_play_next:
downloadRecursively(artist.getId(), false, false, true, true, false); downloadRecursively(artist.getId(), false, false, true, true, false, true);
break; break;
case R.id.artist_menu_play_last: case R.id.artist_menu_play_last:
downloadRecursively(artist.getId(), false, true, false, false, false); downloadRecursively(artist.getId(), false, true, false, false, false, false);
break; break;
case R.id.artist_menu_pin: case R.id.artist_menu_pin:
downloadRecursively(artist.getId(), true, true, false, false, false); downloadRecursively(artist.getId(), true, true, false, false, false, false);
break; break;
default: default:
return super.onContextItemSelected(menuItem); return super.onContextItemSelected(menuItem);

View File

@ -143,7 +143,7 @@ public class SelectPlaylistActivity extends SubsonicTabActivity implements Adapt
Intent intent; Intent intent;
switch (menuItem.getItemId()) { switch (menuItem.getItemId()) {
case R.id.playlist_menu_pin: case R.id.playlist_menu_pin:
downloadPlaylist(playlist.getId(), playlist.getName(), true, true, false, false, true); downloadPlaylist(playlist.getId(), playlist.getName(), true, true, false, false, true, false);
break; break;
case R.id.playlist_menu_play_now: case R.id.playlist_menu_play_now:
intent = new Intent(SelectPlaylistActivity.this, SelectAlbumActivity.class); intent = new Intent(SelectPlaylistActivity.this, SelectAlbumActivity.class);

View File

@ -418,13 +418,13 @@ public class SubsonicTabActivity extends Activity implements OnClickListener{
return IMAGE_LOADER; return IMAGE_LOADER;
} }
protected void downloadRecursively(final String id, final boolean save, final boolean append, final boolean autoplay, final boolean shuffle, final boolean background) { protected void downloadRecursively(final String id, final boolean save, final boolean append, final boolean autoplay, final boolean shuffle, final boolean background, final boolean playNext) {
downloadRecursively(id, "", true, save, append, autoplay, shuffle, background); downloadRecursively(id, "", true, save, append, autoplay, shuffle, background, playNext);
} }
protected void downloadPlaylist(final String id, final String name, final boolean save, final boolean append, final boolean autoplay, final boolean shuffle, final boolean background) { protected void downloadPlaylist(final String id, final String name, final boolean save, final boolean append, final boolean autoplay, final boolean shuffle, final boolean background, final boolean playNext) {
downloadRecursively(id, name, false, save, append, autoplay, shuffle, background); downloadRecursively(id, name, false, save, append, autoplay, shuffle, background, playNext);
} }
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) { 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) {
ModalBackgroundTask<List<MusicDirectory.Entry>> task = new ModalBackgroundTask<List<MusicDirectory.Entry>>(this, false) { ModalBackgroundTask<List<MusicDirectory.Entry>> task = new ModalBackgroundTask<List<MusicDirectory.Entry>>(this, false) {
private static final int MAX_SONGS = 500; private static final int MAX_SONGS = 500;
@ -461,12 +461,12 @@ public class SubsonicTabActivity extends Activity implements OnClickListener{
protected void done(List<MusicDirectory.Entry> songs) { protected void done(List<MusicDirectory.Entry> songs) {
DownloadService downloadService = getDownloadService(); DownloadService downloadService = getDownloadService();
if (!songs.isEmpty() && downloadService != null) { if (!songs.isEmpty() && downloadService != null) {
if (!append) { if (!append && !playNext) {
downloadService.clear(); downloadService.clear();
} }
warnIfNetworkOrStorageUnavailable(); warnIfNetworkOrStorageUnavailable();
if(!background) { if(!background) {
downloadService.download(songs, save, autoplay, false, shuffle); downloadService.download(songs, save, autoplay, playNext, shuffle);
if (!append && Util.getShouldTransitionOnPlaybackPreference(SubsonicTabActivity.this)) { if (!append && Util.getShouldTransitionOnPlaybackPreference(SubsonicTabActivity.this)) {
Util.startActivityWithoutTransition(SubsonicTabActivity.this, DownloadActivity.class); Util.startActivityWithoutTransition(SubsonicTabActivity.this, DownloadActivity.class);
} }