优化
This commit is contained in:
@@ -11,7 +11,6 @@ import io.legado.app.data.entities.rule.TocRule
|
|||||||
import io.legado.app.exception.NoStackTraceException
|
import io.legado.app.exception.NoStackTraceException
|
||||||
import io.legado.app.exception.TocEmptyException
|
import io.legado.app.exception.TocEmptyException
|
||||||
import io.legado.app.help.book.ContentProcessor
|
import io.legado.app.help.book.ContentProcessor
|
||||||
import io.legado.app.help.book.readSimulating
|
|
||||||
import io.legado.app.help.book.simulatedTotalChapterNum
|
import io.legado.app.help.book.simulatedTotalChapterNum
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
import io.legado.app.model.Debug
|
import io.legado.app.model.Debug
|
||||||
@@ -146,13 +145,6 @@ object BookChapterList {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
val replaceRules = ContentProcessor.get(book.name, book.origin).getTitleReplaceRules()
|
val replaceRules = ContentProcessor.get(book.name, book.origin).getTitleReplaceRules()
|
||||||
val lastChapter = if (book.readSimulating()) {
|
|
||||||
list.getOrElse(book.simulatedTotalChapterNum() - 1) { list.last() }
|
|
||||||
} else {
|
|
||||||
list.last()
|
|
||||||
}
|
|
||||||
book.latestChapterTitle =
|
|
||||||
lastChapter.getDisplayTitle(replaceRules, book.getUseReplaceRule())
|
|
||||||
book.durChapterTitle = list.getOrElse(book.durChapterIndex) { list.last() }
|
book.durChapterTitle = list.getOrElse(book.durChapterIndex) { list.last() }
|
||||||
.getDisplayTitle(replaceRules, book.getUseReplaceRule())
|
.getDisplayTitle(replaceRules, book.getUseReplaceRule())
|
||||||
if (book.totalChapterNum < list.size) {
|
if (book.totalChapterNum < list.size) {
|
||||||
@@ -161,6 +153,9 @@ object BookChapterList {
|
|||||||
}
|
}
|
||||||
book.lastCheckTime = System.currentTimeMillis()
|
book.lastCheckTime = System.currentTimeMillis()
|
||||||
book.totalChapterNum = list.size
|
book.totalChapterNum = list.size
|
||||||
|
book.latestChapterTitle =
|
||||||
|
list.getOrElse(book.simulatedTotalChapterNum() - 1) { list.last() }
|
||||||
|
.getDisplayTitle(replaceRules, book.getUseReplaceRule())
|
||||||
coroutineContext.ensureActive()
|
coroutineContext.ensureActive()
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user