Merge remote-tracking branch 'origin/master'

pull/32/head
Administrator 5 years ago
commit 3f4f516272
  1. 1
      app/src/main/java/io/legado/app/data/entities/SearchBook.kt
  2. 25
      app/src/main/java/io/legado/app/model/webbook/BookInfo.kt
  3. 8
      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,30 @@
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
)
)
}
}

@ -82,6 +82,9 @@ object BookList {
}
}
}
if (reverse) {
bookList.reverse()
}
}
return bookList
}
@ -103,6 +106,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 +131,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 +154,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