aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-09-05 13:16:46 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-09-05 13:16:46 -0700
commitaceb2c6f9e2676fd7229a83ad63ffecdd480945c (patch)
tree4d079f7d83f3a9ed3b8b852458ce7ac0feb74d7a /src
parent8564e51ba33ef503ebd517aca5818cae6a3153a8 (diff)
downloaddsub-aceb2c6f9e2676fd7229a83ad63ffecdd480945c.tar.gz
dsub-aceb2c6f9e2676fd7229a83ad63ffecdd480945c.tar.bz2
dsub-aceb2c6f9e2676fd7229a83ad63ffecdd480945c.zip
Gracefully back off of trying to download songs with server issues
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadServiceImpl.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
index 66d31a0f..cae3624b 100644
--- a/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
+++ b/src/github/daneren2005/dsub/service/DownloadServiceImpl.java
@@ -1380,7 +1380,7 @@ public class DownloadServiceImpl extends Service implements DownloadService {
int i = start;
do {
DownloadFile downloadFile = downloadList.get(i);
- if (!downloadFile.isWorkDone()) {
+ if (!downloadFile.isWorkDone() && !downloadFile.isFailedMax()) {
if (downloadFile.shouldSave() || preloaded < Util.getPreloadCount(this)) {
currentDownloading = downloadFile;
currentDownloading.download();
@@ -1407,10 +1407,12 @@ public class DownloadServiceImpl extends Service implements DownloadService {
revision++;
i--;
} else {
- currentDownloading = downloadFile;
- currentDownloading.download();
- cleanupCandidates.add(currentDownloading);
- break;
+ if(!downloadFile.isFailedMax()) {
+ currentDownloading = downloadFile;
+ currentDownloading.download();
+ cleanupCandidates.add(currentDownloading);
+ break;
+ }
}
}
}