[优化] 优化目录页面性能和界面

This commit is contained in:
HapeLee
2026-02-21 00:46:23 +08:00
parent b749400162
commit b31f56b953
7 changed files with 576 additions and 539 deletions
@@ -109,6 +109,9 @@ interface BookDao {
@Query("SELECT * FROM books WHERE bookUrl = :bookUrl")
fun getBook(bookUrl: String): Book?
@Query("SELECT * FROM books WHERE bookUrl = :bookUrl")
fun flowGetBook(bookUrl: String): Flow<Book?>
@Query("SELECT * FROM books WHERE name = :name and author = :author")
fun getBook(name: String, author: String): Book?
@@ -189,7 +189,7 @@ object BookHelp {
if (book.isOnLineTxt && AppConfig.tocCountWords) {
val wordCount = StringUtils.wordCountFormat(content.length)
bookChapter.wordCount = wordCount
appDb.bookChapterDao.upWordCount(bookChapter.bookUrl, bookChapter.url, wordCount)
appDb.bookChapterDao.update(bookChapter)
}
}
@@ -52,14 +52,14 @@ object CacheBook {
val downloadSummaryFlow = _downloadSummaryFlow.asStateFlow()
private val _downloadingIndicesFlow =
MutableSharedFlow<Pair<String, Set<Int>>>(extraBufferCapacity = 64)
MutableStateFlow<Pair<String, Set<Int>>>("" to emptySet())
val downloadingIndicesFlow = _downloadingIndicesFlow.asSharedFlow()