feat: 优化代码

pull/120/head
kunfei 5 years ago
parent 310d89d23a
commit ea3db51478
  1. 9
      app/src/main/java/io/legado/app/model/WebBook.kt

@ -86,7 +86,8 @@ class WebBook(val bookSource: BookSource) {
): Coroutine<Book> {
book.type = bookSource.bookSourceType
return Coroutine.async(scope, context) {
val body = if (!book.infoHtml.isNullOrEmpty()) {
val body =
if (!book.infoHtml.isNullOrEmpty()) {
book.infoHtml
} else {
val analyzeUrl = AnalyzeUrl(
@ -112,7 +113,8 @@ class WebBook(val bookSource: BookSource) {
): Coroutine<List<BookChapter>> {
book.type = bookSource.bookSourceType
return Coroutine.async(scope, context) {
val body = if (book.bookUrl == book.tocUrl && !book.tocHtml.isNullOrEmpty()) {
val body =
if (book.bookUrl == book.tocUrl && !book.tocHtml.isNullOrEmpty()) {
book.tocHtml
} else {
AnalyzeUrl(
@ -141,7 +143,8 @@ class WebBook(val bookSource: BookSource) {
Debug.log(sourceUrl, "⇒正文规则为空,使用章节链接:${bookChapter.url}")
return@async bookChapter.url
}
val body = if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) {
val body =
if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) {
book.tocHtml
} else {
val analyzeUrl =

Loading…
Cancel
Save