aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-12-09 16:05:09 -0800
committerdaneren2005 <daneren2005@gmail.com>2013-12-09 16:05:09 -0800
commit1f982aa8feff78afe099ea4721438f0ae126de4a (patch)
tree3b04d032839eac556330dfa8481b6b03eacbca6c /src
parent8ee3710b1d9e4a1e7a4d56bfd74d9d6a110c92d7 (diff)
downloaddsub-1f982aa8feff78afe099ea4721438f0ae126de4a.tar.gz
dsub-1f982aa8feff78afe099ea4721438f0ae126de4a.tar.bz2
dsub-1f982aa8feff78afe099ea4721438f0ae126de4a.zip
Add downloadRecursively to SubsonicSyncAdapter
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
index 4dc3ae11..27ecbb2c 100644
--- a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
+++ b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
@@ -114,4 +114,19 @@ public class SubsonicSyncAdapter extends AbstractThreadedSyncAdapter {
public void onExecuteSync(Context context, int instance) {
}
+
+ protected void downloadRecursively(MusicDirectory.Entry parent, Context context) {
+ for (MusicDirectory.Entry parent: album.getChildren(false, true)) {
+ if (!song.isVideo()) {
+ DownloadFile file = new DownloadFile(context, song, true);
+ while(!file.isSaved() && !file.isFailedMax()) {
+ file.downloadNow();
+ }
+ }
+ }
+
+ for (MusicDirectory.Entry dir: parent.getChildren(true, false)) {
+ downloadRecursively(musicService.getMusicDirectory(dir.getId(), dir.getTitle(), true, context, null), context);
+ }
+ }
}