diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-09-24 23:13:12 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-09-24 23:13:12 -0700 |
commit | 1b6fb979a5d39895024d872e292487081b498370 (patch) | |
tree | c8a42e95d678008d44cd7b585265d0ecd9f556c2 /subsonic-android/src/github/daneren2005 | |
parent | 5a3c6afdc830a51775dfc9020d54aa9334fb6b97 (diff) | |
download | dsub-1b6fb979a5d39895024d872e292487081b498370.tar.gz dsub-1b6fb979a5d39895024d872e292487081b498370.tar.bz2 dsub-1b6fb979a5d39895024d872e292487081b498370.zip |
Cache now does a background download instead of being added to playlist
Diffstat (limited to 'subsonic-android/src/github/daneren2005')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java index b0c47a5e..d5312375 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java @@ -154,7 +154,7 @@ public class SelectAlbumActivity extends SubsonicTabActivity { refresh(); return true; case R.id.menu_cache: - download(true, true, false, false, false); + downloadBackground(true); selectAll(false, false); return true; case R.id.menu_delete: @@ -409,6 +409,25 @@ public class SelectAlbumActivity extends SubsonicTabActivity { checkLicenseAndTrialPeriod(onValid); } + private void downloadBackground(final boolean save) { + if (getDownloadService() == null) { + return; + } + + final List<MusicDirectory.Entry> songs = getSelectedSongs(); + Runnable onValid = new Runnable() { + @Override + public void run() { + warnIfNetworkOrStorageUnavailable(); + getDownloadService().downloadBackground(songs, save); + + Util.toast(SelectAlbumActivity.this, + getResources().getQuantityString(R.plurals.select_album_n_songs_downloading, songs.size(), songs.size())); + } + }; + + checkLicenseAndTrialPeriod(onValid); + } private void delete() { if (getDownloadService() != null) { |