pull/32/head
kunfei 5 years ago
parent c1bab5adbd
commit 35e9106bcc
  1. 1
      app/src/main/java/io/legado/app/data/entities/SearchBook.kt
  2. 24
      app/src/main/java/io/legado/app/model/webbook/BookInfo.kt
  3. 5
      app/src/main/java/io/legado/app/model/webbook/BookList.kt

@ -23,6 +23,7 @@ data class SearchBook(
var kind: String? = null,
var coverUrl: String? = null,
var intro: String? = null,
var wordCount: String? = null,
var latestChapterTitle: String? = null,
var time: Long = 0L,
var variable: String? = null,

@ -1,5 +1,29 @@
package io.legado.app.model.webbook
import io.legado.app.App
import io.legado.app.R
import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookSource
import io.legado.app.model.analyzeRule.AnalyzeUrl
object BookInfo {
@Throws(Exception::class)
fun analyzeBookInfo(
book: Book,
body: String?,
bookSource: BookSource,
analyzeUrl: AnalyzeUrl,
isSearch: Boolean = true
) {
val baseUrl = analyzeUrl.url
body ?: throw Exception(
App.INSTANCE.getString(
R.string.get_web_content_error,
baseUrl
)
)
}
}

@ -103,6 +103,8 @@ object BookList {
searchBook.intro = analyzeRule.getString(intro ?: "")
searchBook.latestChapterTitle = analyzeRule.getString(lastChapter ?: "")
searchBook.kind = analyzeRule.getString(kind ?: "")
searchBook.wordCount = analyzeRule.getString(wordCount ?: "")
return searchBook
}
}
@ -126,7 +128,7 @@ object BookList {
searchBook.coverUrl = nativeObject[bookListRule.coverUrl]?.toString()
searchBook.intro = nativeObject[bookListRule.intro]?.toString()
searchBook.kind = nativeObject[bookListRule.kind]?.toString()
searchBook.wordCount = nativeObject[bookListRule.wordCount]?.toString()
return searchBook
}
return null
@ -149,6 +151,7 @@ object BookList {
searchBook.author = analyzeRule.getString(bookListRule.author ?: "")
searchBook.kind = analyzeRule.getString(bookListRule.kind ?: "")
searchBook.intro = analyzeRule.getString(bookListRule.intro ?: "")
searchBook.wordCount = analyzeRule.getString(bookListRule.wordCount ?: "")
return searchBook
}

Loading…
Cancel
Save