diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-06-26 19:50:32 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-06-26 19:50:32 +0200 |
commit | c3509b1b92281dc6840052ea5cdf2b4ae1984a49 (patch) | |
tree | 2085a74329d1346d5058d835942514dbd0128472 /src/de/podfetcher/feed | |
parent | e5e7015df314d419035d9788c50a6ca63520e926 (diff) | |
download | AntennaPod-c3509b1b92281dc6840052ea5cdf2b4ae1984a49.zip |
Added support for Simplechapters
Diffstat (limited to 'src/de/podfetcher/feed')
-rw-r--r-- | src/de/podfetcher/feed/FeedItem.java | 9 | ||||
-rw-r--r-- | src/de/podfetcher/feed/FeedManager.java | 13 | ||||
-rw-r--r-- | src/de/podfetcher/feed/SimpleChapter.java | 22 |
3 files changed, 44 insertions, 0 deletions
diff --git a/src/de/podfetcher/feed/FeedItem.java b/src/de/podfetcher/feed/FeedItem.java index 0ad35d6e3..2c127d570 100644 --- a/src/de/podfetcher/feed/FeedItem.java +++ b/src/de/podfetcher/feed/FeedItem.java @@ -1,5 +1,6 @@ package de.podfetcher.feed; +import java.util.ArrayList; import java.util.Date; @@ -19,6 +20,7 @@ public class FeedItem extends FeedComponent{ private Feed feed; protected boolean read; private String paymentLink; + private ArrayList<SimpleChapter> simpleChapters; public FeedItem() { this.read = true; @@ -104,5 +106,12 @@ public class FeedItem extends FeedComponent{ this.paymentLink = paymentLink; } + public ArrayList<SimpleChapter> getSimpleChapters() { + return simpleChapters; + } + + public void setSimpleChapters(ArrayList<SimpleChapter> simpleChapters) { + this.simpleChapters = simpleChapters; + } } diff --git a/src/de/podfetcher/feed/FeedManager.java b/src/de/podfetcher/feed/FeedManager.java index 3533c676f..1e87b8879 100644 --- a/src/de/podfetcher/feed/FeedManager.java +++ b/src/de/podfetcher/feed/FeedManager.java @@ -454,6 +454,19 @@ public class FeedManager { if (!item.read) { unreadItems.add(item); } + + // extract chapters + Cursor chapterCursor = adapter.getSimpleChaptersOfFeedItemCursor(item); + if (chapterCursor.moveToFirst()) { + item.setSimpleChapters(new ArrayList<SimpleChapter>()); + do { + SimpleChapter chapter = new SimpleChapter(chapterCursor.getLong(chapterCursor.getColumnIndex(PodDBAdapter.KEY_START)), + chapterCursor.getString(chapterCursor.getColumnIndex(PodDBAdapter.KEY_TITLE))); + item.getSimpleChapters().add(chapter); + } while (chapterCursor.moveToNext()); + } + chapterCursor.close(); + items.add(item); } while (itemlistCursor.moveToNext()); } diff --git a/src/de/podfetcher/feed/SimpleChapter.java b/src/de/podfetcher/feed/SimpleChapter.java new file mode 100644 index 000000000..c6c489bf2 --- /dev/null +++ b/src/de/podfetcher/feed/SimpleChapter.java @@ -0,0 +1,22 @@ +package de.podfetcher.feed; + +public class SimpleChapter extends FeedComponent { + public long getStart() { + return start; + } + + public SimpleChapter(long start, String title) { + super(); + this.start = start; + this.title = title; + } + + public String getTitle() { + return title; + } + /** Defines starting point in milliseconds. */ + private long start; + private String title; + + +} |