From 67d527a4b2b5e298d0277d5e0177b9b797e74fbd Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 26 Sep 2012 21:49:50 -0700 Subject: Fix for background download condition checking --- .../src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'subsonic-android/src') 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 -- cgit v1.2.3