diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-17 19:41:02 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-17 19:41:02 +0100 |
commit | 6ec174e0fbda3ebec087af7ca4773cdf39e68f98 (patch) | |
tree | 429f808bd395d767edd6851a4e4282f3f01d42c7 | |
parent | 9cc4a5a6caf59052de79941548c7ee5d9a031a06 (diff) | |
download | AntennaPod-6ec174e0fbda3ebec087af7ca4773cdf39e68f98.zip |
Exponential back-off if storage is full
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index c3afff276..efd2a5b06 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -204,8 +204,10 @@ public class DownloadService extends Service { return; } FeedItem item = media.getItem(); - if (status.getReason() == DownloadError.ERROR_HTTP_DATA_ERROR && - Integer.valueOf(status.getReasonDetailed()) == HttpURLConnection.HTTP_NOT_FOUND) { + boolean httpNotFound = status.getReason() == DownloadError.ERROR_HTTP_DATA_ERROR + && String.valueOf(HttpURLConnection.HTTP_NOT_FOUND).equals(status.getReasonDetailed()); + boolean notEnoughSpace = status.getReason() == DownloadError.ERROR_NOT_ENOUGH_SPACE; + if (httpNotFound || notEnoughSpace) { DBWriter.saveFeedItemAutoDownloadFailed(item).get(); } // to make lists reload the failed item, we fake an item update |