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)
|
if (AppConfig.DEBUG)
|
||||||
Log.d(TAG, "Key: " + key + ", value: " + value);
|
Log.d(TAG, "Key: " + key + ", value: " + value);
|
||||||
String attribute = VorbisCommentChapter.getAttributeTypeFromKey(key);
|
String attribute = VorbisCommentChapter.getAttributeTypeFromKey(key);
|
||||||
if (attribute == null) {
|
|
||||||
int id = VorbisCommentChapter.getIDFromKey(key);
|
int id = VorbisCommentChapter.getIDFromKey(key);
|
||||||
|
Chapter chapter = getChapterById(id);
|
||||||
|
if (attribute == null) {
|
||||||
if (getChapterById(id) == null) {
|
if (getChapterById(id) == null) {
|
||||||
// new chapter
|
// new chapter
|
||||||
long start = VorbisCommentChapter.getStartTimeFromValue(value);
|
long start = VorbisCommentChapter.getStartTimeFromValue(value);
|
||||||
VorbisCommentChapter chapter = new VorbisCommentChapter(id);
|
chapter = new VorbisCommentChapter(id);
|
||||||
chapter.setStart(start);
|
chapter.setStart(start);
|
||||||
chapters.add(chapter);
|
chapters.add(chapter);
|
||||||
} else {
|
} else {
|
||||||
|
@ -57,10 +58,12 @@ public class VorbisCommentChapterReader extends VorbisCommentReader {
|
||||||
+ value + ")");
|
+ value + ")");
|
||||||
}
|
}
|
||||||
} else if (attribute.equals(CHAPTER_ATTRIBUTE_TITLE)) {
|
} else if (attribute.equals(CHAPTER_ATTRIBUTE_TITLE)) {
|
||||||
int id = VorbisCommentChapter.getIDFromKey(key);
|
if (chapter != null) {
|
||||||
Chapter c = getChapterById(id);
|
chapter.setTitle(value);
|
||||||
if (c != null) {
|
}
|
||||||
c.setTitle(value);
|
} else if (attribute.equals(CHAPTER_ATTRIBUTE_LINK)) {
|
||||||
|
if (chapter != null) {
|
||||||
|
chapter.setLink(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue