aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-09-26 21:49:50 -0700
committerScott Jackson <daneren2005@gmail.com>2012-09-26 21:49:50 -0700
commit67d527a4b2b5e298d0277d5e0177b9b797e74fbd (patch)
tree3389656f7a5bddbb2bae371458109f7e2d6811d3 /subsonic-android/src
parent8f96d43e5bd1648e363c4cf22eacb1d6961ce699 (diff)
downloaddsub-67d527a4b2b5e298d0277d5e0177b9b797e74fbd.tar.gz
dsub-67d527a4b2b5e298d0277d5e0177b9b797e74fbd.tar.bz2
dsub-67d527a4b2b5e298d0277d5e0177b9b797e74fbd.zip
Fix for background download condition checking
Diffstat (limited to 'subsonic-android/src')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 63fa3fb5..cb7ea3e0 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -885,7 +885,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
}
// Find a suitable target for download.
- else if (currentDownloading == null || currentDownloading.isWorkDone() || currentDownloading.isFailed() && !downloadList.isEmpty()) {
+ else if (currentDownloading == null || currentDownloading.isWorkDone() || currentDownloading.isFailed() && (!downloadList.isEmpty() || !backgroundDownloadList.isEmpty())) {
int n = size();
if (n == 0) {
return;
@@ -911,9 +911,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
i = (i + 1) % n;
} while (i != start);
- // Log.d(TAG, "i: " + i + "\nPreloaded: " + preloaded + "\nSize: " + n);
- if((i + 1 + preloaded == n) && !backgroundDownloadList.isEmpty()) {
- // Log.d(TAG, "Download Background");
+ if((preloaded + 1 == n) && !backgroundDownloadList.isEmpty()) {
for(DownloadFile downloadFile : backgroundDownloadList) {
if(downloadFile.isWorkDone()) {
// Don't need to keep list like active song list