优化
Some checks failed
Test Build / prepare (push) Waiting to run
Test Build / build (app, release) (push) Blocked by required conditions
Test Build / build (app, releaseA) (push) Blocked by required conditions
Test Build / prerelease (push) Blocked by required conditions
Test Build / lanzou (push) Blocked by required conditions
Test Build / test_Branch (push) Blocked by required conditions
Test Build / telegram (push) Blocked by required conditions
Update Cronet / build (push) Has been cancelled

This commit is contained in:
Horis
2025-02-16 20:06:44 +08:00
parent 1bd879e9c3
commit ba31544bba
2 changed files with 6 additions and 2 deletions

View File

@@ -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)
}

View File

@@ -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)
}
}