aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2014-06-18 09:14:30 -0700
committerdaneren2005 <daneren2005@gmail.com>2014-06-18 09:14:30 -0700
commita283e27f6aba61c404c50d73819398611afd14f5 (patch)
treebc39fafc7780b0b2c1172793b130b46ec3acb0ee
parenta7bb5fda81c7aba1561d90b3cd81cae6c9687370 (diff)
downloaddsub-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.java12
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;
}
}
}