diff options
author | Daniel Oeh <daniel@danielpc.(none)> | 2012-05-30 17:19:20 +0200 |
---|---|---|
committer | Daniel Oeh <daniel@danielpc.(none)> | 2012-05-30 17:19:20 +0200 |
commit | 1cb46ad0371573053ead9231347fbc703137dfbb (patch) | |
tree | 55187237d93f839b506f8d2875dbd9855264704f /src/de/podfetcher/feed | |
parent | d98fa5746836ed623463e5c6c2cd57276c3f6eab (diff) | |
download | AntennaPod-1cb46ad0371573053ead9231347fbc703137dfbb.zip |
Rewrote DownloadObserver
Diffstat (limited to 'src/de/podfetcher/feed')
-rw-r--r-- | src/de/podfetcher/feed/Feed.java | 1 | ||||
-rw-r--r-- | src/de/podfetcher/feed/FeedFile.java | 12 | ||||
-rw-r--r-- | src/de/podfetcher/feed/FeedImage.java | 1 | ||||
-rw-r--r-- | src/de/podfetcher/feed/FeedMedia.java | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/src/de/podfetcher/feed/Feed.java b/src/de/podfetcher/feed/Feed.java index 66be64778..e200fbaad 100644 --- a/src/de/podfetcher/feed/Feed.java +++ b/src/de/podfetcher/feed/Feed.java @@ -24,6 +24,7 @@ public class Feed extends FeedFile{ } public Feed(String url) { + super(); this.download_url = url; } diff --git a/src/de/podfetcher/feed/FeedFile.java b/src/de/podfetcher/feed/FeedFile.java index fce50d08f..722a968b9 100644 --- a/src/de/podfetcher/feed/FeedFile.java +++ b/src/de/podfetcher/feed/FeedFile.java @@ -5,6 +5,10 @@ public abstract class FeedFile extends FeedComponent { protected String file_url; protected String download_url; protected long downloadId; // temporary id given by the Android DownloadManager + + public FeedFile() { + downloadId = -1; + } public String getFile_url() { return file_url; @@ -26,4 +30,12 @@ public abstract class FeedFile extends FeedComponent { public void setDownloadId(long downloadId) { this.downloadId = downloadId; } + + public boolean isDownloaded() { + return downloadId == -1 && file_url != null; + } + + public boolean isDownloading() { + return downloadId != -1 && file_url != null; + } } diff --git a/src/de/podfetcher/feed/FeedImage.java b/src/de/podfetcher/feed/FeedImage.java index 02d83b5ae..098aa15b6 100644 --- a/src/de/podfetcher/feed/FeedImage.java +++ b/src/de/podfetcher/feed/FeedImage.java @@ -14,6 +14,7 @@ public class FeedImage extends FeedFile { } public FeedImage(long id, String title, String file_url, String download_url) { + super(); this.id = id; this.title = title; this.file_url = file_url; diff --git a/src/de/podfetcher/feed/FeedMedia.java b/src/de/podfetcher/feed/FeedMedia.java index 1234cc0bd..ca2a534f2 100644 --- a/src/de/podfetcher/feed/FeedMedia.java +++ b/src/de/podfetcher/feed/FeedMedia.java @@ -8,6 +8,7 @@ public class FeedMedia extends FeedFile{ private FeedItem item; public FeedMedia(FeedItem i, String download_url, long size, String mime_type) { + super(); this.item = i; this.download_url = download_url; this.size = size; |