优化
This commit is contained in:
@@ -88,10 +88,6 @@ class ContentProcessor private constructor(
|
|||||||
return contentReplaceRules
|
return contentReplaceRules
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAllReplaceRules(): List<ReplaceRule> {
|
|
||||||
return titleReplaceRules + contentReplaceRules
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getContent(
|
fun getContent(
|
||||||
book: Book,
|
book: Book,
|
||||||
chapter: BookChapter,
|
chapter: BookChapter,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class ReplaceRuleViewModel(application: Application) : BaseViewModel(application
|
|||||||
if (showApplied) {
|
if (showApplied) {
|
||||||
val book = ReadBook.book ?: return@execute
|
val book = ReadBook.book ?: return@execute
|
||||||
val textChapter = ReadBook.curTextChapter ?: return@execute
|
val textChapter = ReadBook.curTextChapter ?: return@execute
|
||||||
enabledForBookRules = ContentProcessor.get(book).getAllReplaceRules().toSet()
|
enabledForBookRules = ContentProcessor.get(book).getContentReplaceRules().toSet()
|
||||||
textChapter.effectiveReplaceRules?.let {
|
textChapter.effectiveReplaceRules?.let {
|
||||||
appliedForBookRules = it.toSet()
|
appliedForBookRules = it.toSet()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user