Search in sources :

Example 1 with VorbisCommentChapterReader

use of de.danoeh.antennapod.parser.media.vorbis.VorbisCommentChapterReader in project AntennaPod by AntennaPod.

the class ChapterUtils method readOggChaptersFromInputStream.

@NonNull
private static List<Chapter> readOggChaptersFromInputStream(InputStream input) throws VorbisCommentReaderException {
    VorbisCommentChapterReader reader = new VorbisCommentChapterReader();
    reader.readInputStream(input);
    List<Chapter> chapters = reader.getChapters();
    if (chapters == null) {
        return Collections.emptyList();
    }
    Collections.sort(chapters, new ChapterStartTimeComparator());
    enumerateEmptyChapterTitles(chapters);
    if (chaptersValid(chapters)) {
        return chapters;
    }
    return Collections.emptyList();
}
Also used : ChapterStartTimeComparator(de.danoeh.antennapod.core.util.comparator.ChapterStartTimeComparator) Chapter(de.danoeh.antennapod.model.feed.Chapter) VorbisCommentChapterReader(de.danoeh.antennapod.parser.media.vorbis.VorbisCommentChapterReader) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)1 ChapterStartTimeComparator (de.danoeh.antennapod.core.util.comparator.ChapterStartTimeComparator)1 Chapter (de.danoeh.antennapod.model.feed.Chapter)1 VorbisCommentChapterReader (de.danoeh.antennapod.parser.media.vorbis.VorbisCommentChapterReader)1