pull/1125/head
gedoor 4 years ago
parent bf7aa99e25
commit cffb2ff740
  1. 32
      app/src/main/java/io/legado/app/model/localBook/LocalBook.kt

@ -26,22 +26,30 @@ object LocalBook {
} }
fun getChapterList(book: Book): ArrayList<BookChapter> { fun getChapterList(book: Book): ArrayList<BookChapter> {
return if (book.isEpub()) { return when {
EpubFile.getChapterList(book) book.isEpub() -> {
}else if(book.isUmd()){ EpubFile.getChapterList(book)
UmdFile.getChapterList(book) }
} else { book.isUmd() -> {
AnalyzeTxtFile().analyze(book) UmdFile.getChapterList(book)
}
else -> {
AnalyzeTxtFile().analyze(book)
}
} }
} }
fun getContext(book: Book, chapter: BookChapter): String? { fun getContext(book: Book, chapter: BookChapter): String? {
return if (book.isEpub()) { return when {
EpubFile.getContent(book, chapter) book.isEpub() -> {
}else if (book.isUmd()){ EpubFile.getContent(book, chapter)
UmdFile.getContent(book, chapter) }
} else { book.isUmd() -> {
AnalyzeTxtFile.getContent(book, chapter) UmdFile.getContent(book, chapter)
}
else -> {
AnalyzeTxtFile.getContent(book, chapter)
}
} }
} }

Loading…
Cancel
Save