Added support for links in vorbis comment
This commit is contained in:
parent
8cf119ce7f
commit
1210c7a8a4
|
@ -43,12 +43,13 @@ public class VorbisCommentChapterReader extends VorbisCommentReader {
|
|||
if (AppConfig.DEBUG)
|
||||
Log.d(TAG, "Key: " + key + ", value: " + value);
|
||||
String attribute = VorbisCommentChapter.getAttributeTypeFromKey(key);
|
||||
if (attribute == null) {
|
||||
int id = VorbisCommentChapter.getIDFromKey(key);
|
||||
Chapter chapter = getChapterById(id);
|
||||
if (attribute == null) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue