aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-09-24 23:13:12 -0700
committerScott Jackson <daneren2005@gmail.com>2012-09-24 23:13:12 -0700
commit1b6fb979a5d39895024d872e292487081b498370 (patch)
treec8a42e95d678008d44cd7b585265d0ecd9f556c2 /subsonic-android/src/github/daneren2005
parent5a3c6afdc830a51775dfc9020d54aa9334fb6b97 (diff)
downloaddsub-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.java21
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) {