pull/32/head
kunfei 5 years ago
parent 743f6da9b5
commit 862d151365
  1. 2
      app/src/main/java/io/legado/app/data/dao/SearchBookDao.kt
  2. 7
      app/src/main/java/io/legado/app/data/entities/SearchBook.kt
  3. 2
      app/src/main/java/io/legado/app/model/webbook/BookList.kt

@ -13,7 +13,7 @@ interface SearchBookDao {
@Query("SELECT * FROM searchBooks")
fun observeAll(): DataSource.Factory<Int, SearchBook>
@Query("SELECT name, author, '' bookUrl, '' origin, '' originName, min(time) time, max(intro) intro, max(kind) kind, max(coverUrl) coverUrl, max(latestChapterTitle) latestChapterTitle FROM searchBooks where time >= :time group by name and author")
@Query("SELECT name, author, '' bookUrl, '' origin, '' originName, count(origin) originCount, min(time) time, max(intro) intro, max(kind) kind, max(coverUrl) coverUrl, max(latestChapterTitle) latestChapterTitle FROM searchBooks where time >= :time group by name and author order by bookOrder and originOrder and time")
fun observeNew(time: Long): DataSource.Factory<Int, SearchBook>

@ -27,9 +27,14 @@ data class SearchBook(
var latestChapterTitle: String? = null,
var time: Long = 0L,
var variable: String? = null,
var bookInfoHtml: String? = null
var bookInfoHtml: String? = null,
var originOrder: Int = 0,
var bookOrder: Int = 0
) : Parcelable, BaseBook {
@Ignore
var originCount: Int = 0
@IgnoredOnParcel
@Ignore
override var variableMap: HashMap<String, String>? = null

@ -132,6 +132,7 @@ object BookList {
searchBook.latestChapterTitle = analyzeRule.getString(lastChapter ?: "")
SourceDebug.printLog(bookSource.bookSourceUrl, 1, searchBook.latestChapterTitle ?: "")
searchBook.time = System.currentTimeMillis()
searchBook.originOrder = bookSource.customOrder
return searchBook
}
}
@ -184,6 +185,7 @@ object BookList {
searchBook.latestChapterTitle = analyzeRule.getString(ruleLastChapter)
SourceDebug.printLog(bookSource.bookSourceUrl, 1, searchBook.latestChapterTitle ?: "", printLog)
searchBook.time = System.currentTimeMillis()
searchBook.originOrder = bookSource.customOrder
return searchBook
}
return null

Loading…
Cancel
Save