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"
package="com.thejoshwa.ultrasonic.androidapp"
a:installLocation="auto"
a:versionCode="19"
a:versionName="1.1.0.15" >
a:versionCode="20"
a:versionName="1.1.0.16" >
<uses-permission a:name="android.permission.INTERNET" />
<uses-permission a:name="android.permission.READ_PHONE_STATE" />

View File

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

View File

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

View File

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

View File

@ -143,7 +143,7 @@ public class SelectPlaylistActivity extends SubsonicTabActivity implements Adapt
Intent intent;
switch (menuItem.getItemId()) {
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;
case R.id.playlist_menu_play_now:
intent = new Intent(SelectPlaylistActivity.this, SelectAlbumActivity.class);

View File

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