diff options
author | daneren2005 <daneren2005@gmail.com> | 2014-06-18 09:14:30 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2014-06-18 09:14:30 -0700 |
commit | a283e27f6aba61c404c50d73819398611afd14f5 (patch) | |
tree | bc39fafc7780b0b2c1172793b130b46ec3acb0ee | |
parent | a7bb5fda81c7aba1561d90b3cd81cae6c9687370 (diff) | |
download | dsub-a283e27f6aba61c404c50d73819398611afd14f5.tar.gz dsub-a283e27f6aba61c404c50d73819398611afd14f5.tar.bz2 dsub-a283e27f6aba61c404c50d73819398611afd14f5.zip |
Fix case of background downloading stalling
-rw-r--r-- | src/github/daneren2005/dsub/service/DownloadService.java | 12 |
1 files 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; } } } |