aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadFile.java4
-rw-r--r--src/github/daneren2005/dsub/service/DownloadService.java2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java
index 965a2a6f..fb0e50d0 100644
--- a/src/github/daneren2005/dsub/service/DownloadFile.java
+++ b/src/github/daneren2005/dsub/service/DownloadFile.java
@@ -398,6 +398,8 @@ public class DownloadFile implements BufferFile {
if (isCancelled()) {
throw new Exception("Download of '" + song + "' was cancelled");
+ } else if(partialFile.length() == 0) {
+ throw new Exception("Download of '" + song + "' failed. File is 0 bytes long.");
}
downloadAndSaveCoverArt(musicService);
@@ -449,7 +451,7 @@ public class DownloadFile implements BufferFile {
}
new CacheCleaner(context, DownloadService.getInstance()).cleanSpace();
if(DownloadService.getInstance() != null) {
- ((DownloadService) DownloadService.getInstance()).checkDownloads();
+ DownloadService.getInstance().checkDownloads();
}
}
diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java
index 2d82e5fb..cb2fdcb2 100644
--- a/src/github/daneren2005/dsub/service/DownloadService.java
+++ b/src/github/daneren2005/dsub/service/DownloadService.java
@@ -1704,7 +1704,7 @@ public class DownloadService extends Service {
while (!bufferComplete()) {
Thread.sleep(1000L);
- if (isCancelled()) {
+ if (isCancelled() || downloadFile.isFailedMax()) {
return null;
}
}