pull/32/head
kunfei 5 years ago
parent 6dea502771
commit 245d168598
  1. 9
      app/src/main/java/io/legado/app/model/WebBook.kt
  2. 18
      app/src/main/java/io/legado/app/model/webbook/BookContent.kt

@ -7,6 +7,7 @@ import io.legado.app.data.entities.SearchBook
import io.legado.app.help.coroutine.Coroutine
import io.legado.app.model.analyzeRule.AnalyzeUrl
import io.legado.app.model.webbook.BookChapterList
import io.legado.app.model.webbook.BookContent
import io.legado.app.model.webbook.BookInfo
import io.legado.app.model.webbook.BookList
@ -51,5 +52,11 @@ class WebBook(private val bookSource: BookSource) {
}
}
fun getContent(book: Book, bookChapter: BookChapter): Coroutine<String> {
return Coroutine.async {
val analyzeUrl = AnalyzeUrl(book = book, ruleUrl = bookChapter.url)
val response = analyzeUrl.getResponseAsync().await()
BookContent.analyzeContent(response, book, bookChapter, bookSource, analyzeUrl)
}
}
}

@ -1,5 +1,23 @@
package io.legado.app.model.webbook
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookChapter
import io.legado.app.data.entities.BookSource
import io.legado.app.model.analyzeRule.AnalyzeUrl
import retrofit2.Response
object BookContent {
fun analyzeContent(
response: Response<String>,
book: Book,
bookChapter: BookChapter,
bookSource: BookSource,
analyzeUrl: AnalyzeUrl
): String {
return ""
}
}
Loading…
Cancel
Save