mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
Some checks are pending
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
Some checks are pending
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
This commit is contained in:
@@ -32,6 +32,7 @@ object BookList {
|
||||
baseUrl: String,
|
||||
body: String?,
|
||||
isSearch: Boolean = true,
|
||||
isRedirect: Boolean = false
|
||||
): ArrayList<SearchBook> {
|
||||
body ?: throw NoStackTraceException(
|
||||
appCtx.getString(
|
||||
@@ -53,9 +54,11 @@ object BookList {
|
||||
getInfoItem(
|
||||
bookSource,
|
||||
analyzeRule,
|
||||
analyzeUrl,
|
||||
body,
|
||||
baseUrl,
|
||||
ruleData.getVariable()
|
||||
ruleData.getVariable(),
|
||||
isRedirect
|
||||
)?.let { searchBook ->
|
||||
searchBook.infoHtml = body
|
||||
bookList.add(searchBook)
|
||||
@@ -84,7 +87,8 @@ object BookList {
|
||||
if (collections.isEmpty() && bookSource.bookUrlPattern.isNullOrEmpty()) {
|
||||
Debug.log(bookSource.bookSourceUrl, "└列表为空,按详情页解析")
|
||||
getInfoItem(
|
||||
bookSource, analyzeRule, body, baseUrl, ruleData.getVariable()
|
||||
bookSource, analyzeRule, analyzeUrl, body, baseUrl, ruleData.getVariable(),
|
||||
isRedirect
|
||||
)?.let { searchBook ->
|
||||
searchBook.infoHtml = body
|
||||
bookList.add(searchBook)
|
||||
@@ -133,12 +137,18 @@ object BookList {
|
||||
private suspend fun getInfoItem(
|
||||
bookSource: BookSource,
|
||||
analyzeRule: AnalyzeRule,
|
||||
analyzeUrl: AnalyzeUrl,
|
||||
body: String,
|
||||
baseUrl: String,
|
||||
variable: String?
|
||||
variable: String?,
|
||||
isRedirect: Boolean
|
||||
): SearchBook? {
|
||||
val book = Book(variable = variable)
|
||||
book.bookUrl = baseUrl
|
||||
book.bookUrl = if (isRedirect) {
|
||||
baseUrl
|
||||
} else {
|
||||
NetworkUtils.getAbsoluteURL(analyzeUrl.url, analyzeUrl.ruleUrl)
|
||||
}
|
||||
book.origin = bookSource.bookSourceUrl
|
||||
book.originName = bookSource.bookSourceName
|
||||
book.originOrder = bookSource.customOrder
|
||||
|
||||
@@ -79,7 +79,8 @@ object WebBook {
|
||||
analyzeUrl = analyzeUrl,
|
||||
baseUrl = res.url,
|
||||
body = res.body,
|
||||
isSearch = true
|
||||
isSearch = true,
|
||||
isRedirect = res.raw.priorResponse?.isRedirect == true
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user