summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/service
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-09-14 15:53:29 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-09-14 15:53:29 +0200
commit35d083e46356435b0ad264e27d014652f976420f (patch)
tree6dfac1d27dcf2d18ce1b5effbd19e57ed2ccd797 /src/de/danoeh/antennapod/service
parent858cdc6233fa0845cd74edfabc589cef8294076b (diff)
downloadAntennaPod-35d083e46356435b0ad264e27d014652f976420f.zip
Hide download progress in percent if download size is unknown
Diffstat (limited to 'src/de/danoeh/antennapod/service')
-rw-r--r--src/de/danoeh/antennapod/service/download/HttpDownloader.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/de/danoeh/antennapod/service/download/HttpDownloader.java b/src/de/danoeh/antennapod/service/download/HttpDownloader.java
index a12cf3e48..e292bbe40 100644
--- a/src/de/danoeh/antennapod/service/download/HttpDownloader.java
+++ b/src/de/danoeh/antennapod/service/download/HttpDownloader.java
@@ -57,12 +57,15 @@ public class HttpDownloader extends Downloader {
status.setSize(connection.getContentLength());
if (AppConfig.DEBUG)
Log.d(TAG, "Size is " + status.getSize());
+ if (status.getSize() == -1) {
+ status.setSize(DownloadStatus.SIZE_UNKNOWN);
+ }
+
long freeSpace = StorageUtils.getFreeSpaceAvailable();
if (AppConfig.DEBUG)
Log.d(TAG, "Free space is " + freeSpace);
- if (status.getSize() == -1 || status.getSize() <= freeSpace) {
- if (AppConfig.DEBUG)
- Log.d(TAG, "Size is " + status.getSize());
+ if (status.getSize() == DownloadStatus.SIZE_UNKNOWN
+ || status.getSize() <= freeSpace) {
publishProgress();
if (AppConfig.DEBUG)
Log.d(TAG, "Starting download");