|
|
@ -318,23 +318,24 @@ object BookHelp { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
suspend fun disposeContent( |
|
|
|
suspend fun disposeContent( |
|
|
|
|
|
|
|
book: Book, |
|
|
|
title: String, |
|
|
|
title: String, |
|
|
|
name: String, |
|
|
|
|
|
|
|
origin: String?, |
|
|
|
|
|
|
|
content: String, |
|
|
|
content: String, |
|
|
|
enableReplace: Boolean, |
|
|
|
|
|
|
|
): List<String> { |
|
|
|
): List<String> { |
|
|
|
var title1 = title |
|
|
|
var title1 = title |
|
|
|
var content1 = content |
|
|
|
var content1 = content |
|
|
|
if (enableReplace) { |
|
|
|
if (book.getReSegment()) { |
|
|
|
|
|
|
|
content1 = ContentHelp.reSegment(content1, title1) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (book.getUseReplaceRule()) { |
|
|
|
synchronized(this) { |
|
|
|
synchronized(this) { |
|
|
|
if (bookName != name || bookOrigin != origin) { |
|
|
|
if (bookName != book.name || bookOrigin != book.origin) { |
|
|
|
bookName = name |
|
|
|
bookName = book.name |
|
|
|
bookOrigin = origin |
|
|
|
bookOrigin = book.origin |
|
|
|
replaceRules = if (origin.isNullOrEmpty()) { |
|
|
|
replaceRules = if (bookOrigin.isNullOrEmpty()) { |
|
|
|
App.db.replaceRuleDao().findEnabledByScope(name) |
|
|
|
App.db.replaceRuleDao().findEnabledByScope(bookName!!) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
App.db.replaceRuleDao().findEnabledByScope(name, origin) |
|
|
|
App.db.replaceRuleDao().findEnabledByScope(bookName!!, bookOrigin!!) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|