From a283e27f6aba61c404c50d73819398611afd14f5 Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Wed, 18 Jun 2014 09:14:30 -0700 Subject: Fix case of background downloading stalling --- src/github/daneren2005/dsub/service/DownloadService.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index ef98253b..9a9b5a57 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1655,18 +1655,16 @@ public class DownloadService extends Service { if((preloaded + 1 == n || preloaded >= Util.getPreloadCount(this) || downloadList.isEmpty()) && !backgroundDownloadList.isEmpty()) { for(int i = 0; i < backgroundDownloadList.size(); i++) { DownloadFile downloadFile = backgroundDownloadList.get(i); - if(downloadFile.isWorkDone() && (!downloadFile.shouldSave() || downloadFile.isSaved())) { + if(downloadFile.isWorkDone() && (!downloadFile.shouldSave() || downloadFile.isSaved()) || downloadFile.isFailedMax()) { // Don't need to keep list like active song list backgroundDownloadList.remove(i); revision++; i--; } else { - if(!downloadFile.isFailedMax()) { - currentDownloading = downloadFile; - currentDownloading.download(); - cleanupCandidates.add(currentDownloading); - break; - } + currentDownloading = downloadFile; + currentDownloading.download(); + cleanupCandidates.add(currentDownloading); + break; } } } -- cgit v1.2.3