优化
This commit is contained in:
1 parent
d447ef69ff
commit
74143ddd06
2 files changed
+6
-2
No files matched your search
@@ -40,4 +40,7 @@ interface BookChapterDao {
|
||||
@Query("delete from chapters where bookUrl = :bookUrl")
|
||||
fun delByBook(bookUrl: String)
|
||||
|
||||
@Query("update chapters set wordCount = :wordCount where bookUrl = :bookUrl and url = :url")
|
||||
fun upWordCount(bookUrl: String, url: String, wordCount: String)
|
||||
|
||||
}
|
||||
@@ -185,8 +185,9 @@ object BookHelp {
|
||||
bookChapter.getFileName(),
|
||||
).writeText(content)
|
||||
if (book.isOnLineTxt && AppConfig.tocCountWords) {
|
||||
bookChapter.wordCount = StringUtils.wordCountFormat(content.length)
|
||||
appDb.bookChapterDao.update(bookChapter)
|
||||
val wordCount = StringUtils.wordCountFormat(content.length)
|
||||
bookChapter.wordCount = wordCount
|
||||
appDb.bookChapterDao.upWordCount(bookChapter.bookUrl, bookChapter.url, wordCount)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user