summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/asynctask
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-09-20 19:03:21 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-09-20 19:03:21 +0200
commit82db128a6622002a580b56c241c65f8514e0a1c6 (patch)
tree39a8962166a575c364b14e235fdc3f1c8de472e7 /src/de/danoeh/antennapod/asynctask
parentf78bb0be13d946653374ed75ee6b94c18773618c (diff)
downloadAntennaPod-82db128a6622002a580b56c241c65f8514e0a1c6.zip
Added 'title' and 'reasonDetailed' attributes to DownloadStatus
Diffstat (limited to 'src/de/danoeh/antennapod/asynctask')
-rw-r--r--src/de/danoeh/antennapod/asynctask/DownloadStatus.java56
1 files changed, 39 insertions, 17 deletions
diff --git a/src/de/danoeh/antennapod/asynctask/DownloadStatus.java b/src/de/danoeh/antennapod/asynctask/DownloadStatus.java
index 11616b371..047c3060d 100644
--- a/src/de/danoeh/antennapod/asynctask/DownloadStatus.java
+++ b/src/de/danoeh/antennapod/asynctask/DownloadStatus.java
@@ -16,43 +16,57 @@ public class DownloadStatus {
return completionDate;
}
+ // ----------------------------------- ATTRIBUTES STORED IN DB
/** Unique id for storing the object in database. */
protected long id;
+ /**
+ * A human-readable string which is shown to the user so that he can
+ * identify the download. Should be the title of the item/feed/media or the
+ * URL if the download has no other title.
+ */
+ protected String title;
+ protected int reason;
+ /**
+ * A message which can be presented to the user to give more information.
+ * Should be null if Download was successful.
+ */
+ protected String reasonDetailed;
+ protected boolean successful;
+ protected Date completionDate;
- /** Used by DownloadService to check if the status has been updated. */
- protected volatile boolean updateAvailable;
-
+ // ------------------------------------ NOT STORED IN DB
protected FeedFile feedfile;
protected int progressPercent;
protected long soFar;
protected long size;
protected int statusMsg;
- protected int reason;
- protected boolean successful;
protected boolean done;
- protected Date completionDate;
public DownloadStatus(FeedFile feedfile) {
this.feedfile = feedfile;
}
/** Constructor for restoring Download status entries from DB. */
- public DownloadStatus(long id, FeedFile feedfile, boolean successful,
- int reason, Date completionDate) {
- this.id = id;
- this.feedfile = feedfile;
+ public DownloadStatus(long id, String title, FeedFile feedfile,
+ boolean successful, int reason, Date completionDate,
+ String reasonDetailed) {
progressPercent = 100;
soFar = 0;
size = 0;
+
+ this.id = id;
+ this.title = title;
+ this.done = true;
+ this.feedfile = feedfile;
this.reason = reason;
this.successful = successful;
- this.done = true;
this.completionDate = completionDate;
}
/** Constructor for creating new completed downloads. */
- public DownloadStatus(FeedFile feedfile, int reason, boolean successful) {
- this(0, feedfile, successful, reason, new Date());
+ public DownloadStatus(FeedFile feedfile, String title, int reason,
+ boolean successful, String reasonDetailed) {
+ this(0, title, feedfile, successful, reason, new Date(), reasonDetailed);
}
public FeedFile getFeedFile() {
@@ -131,12 +145,20 @@ public class DownloadStatus {
this.completionDate = completionDate;
}
- public boolean isUpdateAvailable() {
- return updateAvailable;
+ public String getReasonDetailed() {
+ return reasonDetailed;
+ }
+
+ public void setReasonDetailed(String reasonDetailed) {
+ this.reasonDetailed = reasonDetailed;
+ }
+
+ public String getTitle() {
+ return title;
}
- public void setUpdateAvailable(boolean updateAvailable) {
- this.updateAvailable = updateAvailable;
+ public void setTitle(String title) {
+ this.title = title;
}
} \ No newline at end of file