From 4608c4cace52b72f7f3630299c6b0ab33c29cb6b Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 12 Mar 2014 21:23:50 -0700 Subject: Fix a case of infinite download --- src/github/daneren2005/dsub/service/DownloadFile.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java index c7b66f8f..965a2a6f 100644 --- a/src/github/daneren2005/dsub/service/DownloadFile.java +++ b/src/github/daneren2005/dsub/service/DownloadFile.java @@ -408,7 +408,11 @@ public class DownloadFile implements BufferFile { } else { if(save) { Util.renameFile(partialFile, saveFile); - mediaStoreService.saveInMediaStore(DownloadFile.this); + try { + mediaStoreService.saveInMediaStore(DownloadFile.this); + } catch(Exception e) { + Log.w(TAG, "Failed to save in media store", e); + } } else { Util.renameFile(partialFile, completeFile); } @@ -428,6 +432,7 @@ public class DownloadFile implements BufferFile { Util.delete(completeFile); Util.delete(saveFile); if (!isCancelled()) { + failed++; failedDownload = true; Log.w(TAG, "Failed to download '" + song + "'.", x); } -- cgit v1.2.3