pull/1319/head
gedoor 4 years ago
parent 7c8ff1ecef
commit 7b2971da81
  1. 6
      app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt

@ -20,6 +20,8 @@ import splitties.init.appCtx
@Suppress("BlockingMethodInNonBlockingContext") @Suppress("BlockingMethodInNonBlockingContext")
object BookChapterList { object BookChapterList {
private val falseRegex = "\\w*(?i)(null|false|0)\\w*".toRegex()
suspend fun analyzeChapterList( suspend fun analyzeChapterList(
scope: CoroutineScope, scope: CoroutineScope,
bookSource: BookSource, bookSource: BookSource,
@ -188,10 +190,10 @@ object BookChapterList {
bookChapter.url = baseUrl bookChapter.url = baseUrl
} }
if (bookChapter.title.isNotEmpty()) { if (bookChapter.title.isNotEmpty()) {
if (isVip.isNotEmpty() && isVip != "null" && isVip != "false" && isVip != "0") { if (isVip.isNotEmpty() && !isVip.matches(falseRegex)) {
bookChapter.isVip = true bookChapter.isVip = true
} }
if (isPay.isNotEmpty() && isPay != "null" && isPay != "false" && isPay != "0") { if (isPay.isNotEmpty() && !isPay.matches(falseRegex)) {
bookChapter.isPay = true bookChapter.isPay = true
} }
chapterList.add(bookChapter) chapterList.add(bookChapter)

Loading…
Cancel
Save