mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
1da18a994f
commit
802515715c
@ -86,8 +86,11 @@ class ContentProcessor private constructor(
|
|||||||
//去除重复标题
|
//去除重复标题
|
||||||
if (BookHelp.removeSameTitle(book, chapter)) try {
|
if (BookHelp.removeSameTitle(book, chapter)) try {
|
||||||
val name = Pattern.quote(book.name)
|
val name = Pattern.quote(book.name)
|
||||||
val title = Pattern.quote(chapter.title)
|
val title0 = Pattern.quote(chapter.title)
|
||||||
val titleRegex = "^(\\s|\\p{P}|${name})*${title}(\\s)*"
|
val title1 = Pattern.quote(
|
||||||
|
chapter.getDisplayTitle(contentReplaceRules, chineseConvert = false)
|
||||||
|
)
|
||||||
|
val titleRegex = "^(\\s|\\p{P}|${name})*(${title0}|${title1})(\\s)*"
|
||||||
val matcher = Pattern.compile(titleRegex)
|
val matcher = Pattern.compile(titleRegex)
|
||||||
.matcher(mContent)
|
.matcher(mContent)
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user