From aceb2c6f9e2676fd7229a83ad63ffecdd480945c Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Thu, 5 Sep 2013 13:16:46 -0700 Subject: Gracefully back off of trying to download songs with server issues --- src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/github/daneren2005') 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; + } } } } -- cgit v1.2.3