pull/885/head^2
gedoor 4 years ago
parent 25e3f65b9a
commit 2991a5ff6c
  1. 2
      app/src/main/java/io/legado/app/data/dao/EpubChapterDao.kt
  2. 2
      app/src/main/java/io/legado/app/model/localBook/EPUBFile.kt

@ -12,7 +12,7 @@ interface EpubChapterDao {
fun getCnt(bookUrl: String): Int fun getCnt(bookUrl: String): Int
@Query("select * from epubChapters Where bookUrl = :bookUrl and parentHref = :parentHref ") @Query("select * from epubChapters Where bookUrl = :bookUrl and parentHref = :parentHref ")
fun get(bookUrl: String, parentHref: String): List<EpubChapter>? fun get(bookUrl: String, parentHref: String): List<EpubChapter>
@Insert(onConflict = OnConflictStrategy.REPLACE) @Insert(onConflict = OnConflictStrategy.REPLACE)
fun insert(vararg chapter: EpubChapter) fun insert(vararg chapter: EpubChapter)

@ -133,7 +133,7 @@ class EPUBFile(var book: io.legado.app.data.entities.Book) {
/*获取当前章节文本*/ /*获取当前章节文本*/
var string = getChildChapter(chapter, chapter.url) var string = getChildChapter(chapter, chapter.url)
val childContends = appDb.epubChapterDao.get(book.bookUrl, chapter.url) val childContends = appDb.epubChapterDao.get(book.bookUrl, chapter.url)
childContends?.forEach { childContends.forEach {
string += "\n" + getChildChapter(chapter, it.href) string += "\n" + getChildChapter(chapter, it.href)
} }
return string return string

Loading…
Cancel
Save