aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-10-03 15:52:48 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-10-03 15:52:48 -0700
commitbdd4f388beb8cce42a960887c6aeba459b201d4b (patch)
treec3ddb2cfa9d7770d0106e764d0da342f7de8f143 /src
parentfe850678058846c68e869ac5985ce74173020b1c (diff)
downloaddsub-bdd4f388beb8cce42a960887c6aeba459b201d4b.tar.gz
dsub-bdd4f388beb8cce42a960887c6aeba459b201d4b.tar.bz2
dsub-bdd4f388beb8cce42a960887c6aeba459b201d4b.zip
Only increment failed count when hitting SubsonicRESTException
SubsonicRESTException should be the only one that means the app will never be able to succeed in downloading the song.
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadFile.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java
index d3593700..4f79bdc9 100644
--- a/src/github/daneren2005/dsub/service/DownloadFile.java
+++ b/src/github/daneren2005/dsub/service/DownloadFile.java
@@ -30,6 +30,7 @@ import android.os.PowerManager;
import android.util.DisplayMetrics;
import android.util.Log;
import github.daneren2005.dsub.domain.MusicDirectory;
+import github.daneren2005.service.parser.SubsonicRESTException;
import github.daneren2005.dsub.util.CancellableTask;
import github.daneren2005.dsub.util.FileUtil;
import github.daneren2005.dsub.util.Util;
@@ -318,12 +319,20 @@ public class DownloadFile {
}
}
+ } catch(SubsonicRESTException x) {
+ Util.close(out);
+ Util.delete(completeFile);
+ Util.delete(saveFile);
+ if (!isCancelled()) {
+ failed++;
+ failedDownload = true;
+ Log.w(TAG, "Failed to download '" + song + "'.", x);
+ }
} catch (Exception x) {
Util.close(out);
Util.delete(completeFile);
Util.delete(saveFile);
if (!isCancelled()) {
- failed++;
failedDownload = true;
Log.w(TAG, "Failed to download '" + song + "'.", x);
}