From 1b6fb979a5d39895024d872e292487081b498370 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 24 Sep 2012 23:13:12 -0700 Subject: Cache now does a background download instead of being added to playlist --- .../dsub/activity/SelectAlbumActivity.java | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'subsonic-android') 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 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) { -- cgit v1.2.3