summaryrefslogtreecommitdiff
path: root/src/de
diff options
context:
space:
mode:
Diffstat (limited to 'src/de')
-rw-r--r--src/de/podfetcher/feed/FeedManager.java4
-rw-r--r--src/de/podfetcher/feed/FeedMedia.java6
-rw-r--r--src/de/podfetcher/storage/PodDBAdapter.java3
3 files changed, 8 insertions, 5 deletions
diff --git a/src/de/podfetcher/feed/FeedManager.java b/src/de/podfetcher/feed/FeedManager.java
index 8baee5a1d..65692a2ea 100644
--- a/src/de/podfetcher/feed/FeedManager.java
+++ b/src/de/podfetcher/feed/FeedManager.java
@@ -227,7 +227,9 @@ public class FeedManager {
item.setLink(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_LINK)));
item.setDescription(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_DESCRIPTION)));
item.setPubDate(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_PUBDATE)));
- item.setMedia(adapter.getFeedMedia(itemlistCursor.getLong(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_MEDIA))));
+ item.setMedia(adapter.getFeedMedia(
+ itemlistCursor.getLong(
+ itemlistCursor.getColumnIndex(PodDBAdapter.KEY_MEDIA)), item));
item.setRead((itemlistCursor.getInt(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_READ)) > 0) ? true : false);
items.add(item);
diff --git a/src/de/podfetcher/feed/FeedMedia.java b/src/de/podfetcher/feed/FeedMedia.java
index 23594d465..1234cc0bd 100644
--- a/src/de/podfetcher/feed/FeedMedia.java
+++ b/src/de/podfetcher/feed/FeedMedia.java
@@ -5,8 +5,7 @@ public class FeedMedia extends FeedFile{
private long position;
private long size; // File size in Byte
private String mime_type;
-
- private FeedItem item; // TODO remove
+ private FeedItem item;
public FeedMedia(FeedItem i, String download_url, long size, String mime_type) {
this.item = i;
@@ -15,10 +14,11 @@ public class FeedMedia extends FeedFile{
this.mime_type = mime_type;
}
- public FeedMedia(long id, long length, long position, long size, String mime_type,
+ public FeedMedia(long id, FeedItem item, long length, long position, long size, String mime_type,
String file_url, String download_url) {
super();
this.id = id;
+ this.item = item;
this.length = length;
this.position = position;
this.size = size;
diff --git a/src/de/podfetcher/storage/PodDBAdapter.java b/src/de/podfetcher/storage/PodDBAdapter.java
index 76266f0d8..6884965f8 100644
--- a/src/de/podfetcher/storage/PodDBAdapter.java
+++ b/src/de/podfetcher/storage/PodDBAdapter.java
@@ -269,7 +269,7 @@ public class PodDBAdapter {
return c;
}
- public FeedMedia getFeedMedia(long row_index) throws SQLException{
+ public FeedMedia getFeedMedia(long row_index, FeedItem owner) throws SQLException{
open();
Cursor cursor = db.query(TABLE_NAME_FEED_MEDIA, null, KEY_ID + "=?",
new String[]{String.valueOf(row_index)}, null, null, null);
@@ -278,6 +278,7 @@ public class PodDBAdapter {
throw new SQLException("No FeedMedia found at index: " + row_index);
}
FeedMedia media = new FeedMedia(row_index,
+ owner,
cursor.getLong(cursor.getColumnIndex(KEY_LENGTH)),
cursor.getLong(cursor.getColumnIndex(KEY_POSITION)),
cursor.getLong(cursor.getColumnIndex(KEY_SIZE)),