diff --git a/app/src/main/java/io/legado/app/model/WebBook.kt b/app/src/main/java/io/legado/app/model/WebBook.kt index ddbf15523..b534cb272 100644 --- a/app/src/main/java/io/legado/app/model/WebBook.kt +++ b/app/src/main/java/io/legado/app/model/WebBook.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 { + return Coroutine.async { + val analyzeUrl = AnalyzeUrl(book = book, ruleUrl = bookChapter.url) + val response = analyzeUrl.getResponseAsync().await() + BookContent.analyzeContent(response, book, bookChapter, bookSource, analyzeUrl) + } + } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/model/webbook/BookContent.kt b/app/src/main/java/io/legado/app/model/webbook/BookContent.kt index 8a037108b..dc480a6f8 100644 --- a/app/src/main/java/io/legado/app/model/webbook/BookContent.kt +++ b/app/src/main/java/io/legado/app/model/webbook/BookContent.kt @@ -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, + book: Book, + bookChapter: BookChapter, + bookSource: BookSource, + analyzeUrl: AnalyzeUrl + ): String { + + + return "" + } + } \ No newline at end of file