summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-11-09 19:40:10 +0100
committerdaniel oeh <daniel.oeh@gmail.com>2012-11-09 19:40:10 +0100
commit1210c7a8a4448ba2b0ac017bd7cb16ea4a5704e8 (patch)
treef7e83a19346fee0d489e3c952a180584e9e84221 /src/de/danoeh/antennapod
parent8cf119ce7f048e03bacdb3d5dcf2aaafe89b2b32 (diff)
downloadAntennaPod-1210c7a8a4448ba2b0ac017bd7cb16ea4a5704e8.zip
Added support for links in vorbis comment
Diffstat (limited to 'src/de/danoeh/antennapod')
-rw-r--r--src/de/danoeh/antennapod/util/vorbiscommentreader/VorbisCommentChapterReader.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/de/danoeh/antennapod/util/vorbiscommentreader/VorbisCommentChapterReader.java b/src/de/danoeh/antennapod/util/vorbiscommentreader/VorbisCommentChapterReader.java
index d9fc4e2af..190d7f2b5 100644
--- a/src/de/danoeh/antennapod/util/vorbiscommentreader/VorbisCommentChapterReader.java
+++ b/src/de/danoeh/antennapod/util/vorbiscommentreader/VorbisCommentChapterReader.java
@@ -43,12 +43,13 @@ public class VorbisCommentChapterReader extends VorbisCommentReader {
if (AppConfig.DEBUG)
Log.d(TAG, "Key: " + key + ", value: " + value);
String attribute = VorbisCommentChapter.getAttributeTypeFromKey(key);
+ int id = VorbisCommentChapter.getIDFromKey(key);
+ Chapter chapter = getChapterById(id);
if (attribute == null) {
- int id = VorbisCommentChapter.getIDFromKey(key);
if (getChapterById(id) == null) {
// new chapter
long start = VorbisCommentChapter.getStartTimeFromValue(value);
- VorbisCommentChapter chapter = new VorbisCommentChapter(id);
+ chapter = new VorbisCommentChapter(id);
chapter.setStart(start);
chapters.add(chapter);
} else {
@@ -57,10 +58,12 @@ public class VorbisCommentChapterReader extends VorbisCommentReader {
+ value + ")");
}
} else if (attribute.equals(CHAPTER_ATTRIBUTE_TITLE)) {
- int id = VorbisCommentChapter.getIDFromKey(key);
- Chapter c = getChapterById(id);
- if (c != null) {
- c.setTitle(value);
+ if (chapter != null) {
+ chapter.setTitle(value);
+ }
+ } else if (attribute.equals(CHAPTER_ATTRIBUTE_LINK)) {
+ if (chapter != null) {
+ chapter.setLink(value);
}
}
}