From 6ec174e0fbda3ebec087af7ca4773cdf39e68f98 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 17 Jan 2016 19:41:02 +0100 Subject: Exponential back-off if storage is full --- .../de/danoeh/antennapod/core/service/download/DownloadService.java | 6 ++++-- 1 file 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 -- cgit v1.2.3