pull/1125/head
gedoor 3 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> {
return if (book.isEpub()) {
EpubFile.getChapterList(book)
}else if(book.isUmd()){
UmdFile.getChapterList(book)
} else {
AnalyzeTxtFile().analyze(book)
return when {
book.isEpub() -> {
EpubFile.getChapterList(book)
}
book.isUmd() -> {
UmdFile.getChapterList(book)
}
else -> {
AnalyzeTxtFile().analyze(book)
}
}
}
fun getContext(book: Book, chapter: BookChapter): String? {
return if (book.isEpub()) {
EpubFile.getContent(book, chapter)
}else if (book.isUmd()){
UmdFile.getContent(book, chapter)
} else {
AnalyzeTxtFile.getContent(book, chapter)
return when {
book.isEpub() -> {
EpubFile.getContent(book, chapter)
}
book.isUmd() -> {
UmdFile.getContent(book, chapter)
}
else -> {
AnalyzeTxtFile.getContent(book, chapter)
}
}
}

Loading…
Cancel
Save