aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-10-02 16:10:48 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-10-02 16:10:48 -0700
commitd1e64c23249d41ac011cce6cebb61cd2590d0e00 (patch)
tree5e1fd7a1ec65c0c1c20b119c0d0872409f550a34 /src
parenta91a034fc78b07481fcb55ebafc9256a18660fd4 (diff)
downloaddsub-d1e64c23249d41ac011cce6cebb61cd2590d0e00.tar.gz
dsub-d1e64c23249d41ac011cce6cebb61cd2590d0e00.tar.bz2
dsub-d1e64c23249d41ac011cce6cebb61cd2590d0e00.zip
Restore a this instance isFailed check + keep separate isFailedMax
This was seriously screwing up the download process if a song had failed once
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadFile.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java
index 3d34157d..d3593700 100644
--- a/src/github/daneren2005/dsub/service/DownloadFile.java
+++ b/src/github/daneren2005/dsub/service/DownloadFile.java
@@ -55,6 +55,7 @@ public class DownloadFile {
private final MediaStoreService mediaStoreService;
private CancellableTask downloadTask;
private boolean save;
+ private boolean failedDownload = false;
private int failed = 0;
private int bitRate;
private boolean isPlaying = false;
@@ -98,6 +99,7 @@ public class DownloadFile {
public synchronized void download() {
FileUtil.createDirectoryForParent(saveFile);
+ failedDownload = false;
if(!partialFile.exists()) {
bitRate = Util.getMaxBitrate(context);
}
@@ -152,7 +154,7 @@ public class DownloadFile {
}
public boolean isFailed() {
- return failed > 0;
+ return failedDownload;
}
public boolean isFailedMax() {
return failed > MAX_FAILURES;
@@ -322,6 +324,7 @@ public class DownloadFile {
Util.delete(saveFile);
if (!isCancelled()) {
failed++;
+ failedDownload = true;
Log.w(TAG, "Failed to download '" + song + "'.", x);
}