aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-10-06 12:42:15 -0700
committerScott Jackson <daneren2005@gmail.com>2012-10-06 12:42:15 -0700
commit9bb3ff579898ec0ee1d9e38bb973abf6e53b4782 (patch)
tree07ceb50e58d89dcfc77e2d8268384994fd1eeaa1 /subsonic-android
parent5e086f1bb8d4167e1cc6fc71989afecf3c0d3626 (diff)
downloaddsub-9bb3ff579898ec0ee1d9e38bb973abf6e53b4782.tar.gz
dsub-9bb3ff579898ec0ee1d9e38bb973abf6e53b4782.tar.bz2
dsub-9bb3ff579898ec0ee1d9e38bb973abf6e53b4782.zip
Added way to extract background downloading files from download service
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java2
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java8
2 files changed, 10 insertions, 0 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
index 556765f2..a2f2868f 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadService.java
@@ -64,6 +64,8 @@ public interface DownloadService {
List<DownloadFile> getSongs();
List<DownloadFile> getDownloads();
+
+ List<DownloadFile> getBackgroundDownloads();
int getCurrentPlayingIndex();
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 7ba54832..09cbb40f 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -403,6 +403,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
setCurrentPlaying(null, false);
}
downloadList.remove(downloadFile);
+ backgroundDownloadList.remove(downloadFile);
revision++;
lifecycleSupport.serializeDownloadQueue();
updateJukeboxPlaylist();
@@ -480,6 +481,13 @@ public class DownloadServiceImpl extends Service implements DownloadService {
temp.addAll(backgroundDownloadList);
return temp;
}
+
+ @Override
+ public synchronized List<DownloadFile> getBackgroundDownloads() {
+ List<DownloadFile> temp = new ArrayList<DownloadFile>();
+ temp.addAll(backgroundDownloadList);
+ return temp;
+ }
/** Plays either the current song (resume) or the first/next one in queue. */
public synchronized void play()