fix: 书源解析获取内容

pull/95/head
kunfei 5 years ago
parent 9485d06bc5
commit 7ba863cbe2
  1. 2
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt
  2. 8
      app/src/main/java/io/legado/app/model/webBook/BookInfo.kt
  3. 2
      app/src/main/java/io/legado/app/model/webBook/BookList.kt

@ -115,7 +115,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions {
}
@Throws(Exception::class)
fun getStringList(ruleList: List<SourceRule>, isUrl: Boolean): List<String>? {
fun getStringList(ruleList: List<SourceRule>, isUrl: Boolean = false): List<String>? {
var result: Any? = null
content?.let { o ->
if (ruleList.isNotEmpty()) {

@ -42,9 +42,11 @@ object BookInfo {
}
Debug.log(bookSource.bookSourceUrl, "${book.author}")
Debug.log(bookSource.bookSourceUrl, "┌获取分类")
analyzeRule.getString(infoRule.kind).let {
if (it.isNotEmpty()) book.kind = it
}
analyzeRule.getStringList(infoRule.kind)
?.joinToString(",")
?.let {
if (it.isNotEmpty()) book.kind = it
}
Debug.log(bookSource.bookSourceUrl, "${book.kind}")
Debug.log(bookSource.bookSourceUrl, "┌获取字数")
analyzeRule.getString(infoRule.wordCount).let {

@ -170,7 +170,7 @@ object BookList {
searchBook.author = BookHelp.formatAuthor(analyzeRule.getString(ruleAuthor))
Debug.log(bookSource.bookSourceUrl, "${searchBook.author}", log)
Debug.log(bookSource.bookSourceUrl, "┌获取分类", log)
searchBook.kind = analyzeRule.getString(ruleKind)
searchBook.kind = analyzeRule.getStringList(ruleKind)?.joinToString(",")
Debug.log(bookSource.bookSourceUrl, "${searchBook.kind}", log)
Debug.log(bookSource.bookSourceUrl, "┌获取字数", log)
searchBook.wordCount = analyzeRule.getString(ruleWordCount)

Loading…
Cancel
Save