pull/32/head
kunfei 5 years ago
parent 5f0f9e2ec7
commit e7a3016439
  1. 21
      app/src/main/java/io/legado/app/data/entities/SearchBook.kt
  2. 16
      app/src/main/java/io/legado/app/model/webbook/BookList.kt

@ -14,17 +14,18 @@ import kotlinx.android.parcel.Parcelize
@Parcelize @Parcelize
@Entity(tableName = "searchBooks", indices = [(Index(value = ["descUrl"], unique = true))]) @Entity(tableName = "searchBooks", indices = [(Index(value = ["descUrl"], unique = true))])
data class SearchBook( data class SearchBook(
@PrimaryKey @PrimaryKey
var descUrl: String = "", var descUrl: String = "",
var origin: String = "", // 书源规则id(默认-1,表示本地书籍) var origin: String = "", // 书源规则id(默认-1,表示本地书籍)
var name: String? = null, var name: String? = null,
var author: String? = null, var author: String? = null,
var tag: String? = null, var tag: String? = null,
var coverUrl: String? = null, var coverUrl: String? = null,
var description: String? = null, var description: String? = null,
var latestChapterTitle: String? = null, var latestChapterTitle: String? = null,
var time: Long = 0L, var time: Long = 0L,
var variable: String? = null var variable: String? = null,
var bookInfoHtml: String? = null
) : Parcelable, BaseBook { ) : Parcelable, BaseBook {
@IgnoredOnParcel @IgnoredOnParcel

@ -29,7 +29,21 @@ class BookList {
) )
val analyzer = AnalyzeRule(null) val analyzer = AnalyzeRule(null)
analyzer.setContent(body, baseUrl) analyzer.setContent(body, baseUrl)
bookSource.bookUrlPattern?.let {
if (baseUrl.matches(it.toRegex())) {
getItem()?.let { searchBook ->
searchBook.bookInfoHtml = body
bookList.add(searchBook)
}
return bookList
}
}
return bookList return bookList
} }
fun getItem(): SearchBook? {
val searchBook = SearchBook()
return null
}
} }
Loading…
Cancel
Save