优化
This commit is contained in:
@@ -32,14 +32,14 @@ suspend fun BookSource.exploreKinds(): List<ExploreKind> {
|
|||||||
mutex.withLock {
|
mutex.withLock {
|
||||||
exploreKindsMap[exploreKindsKey]?.let { return it }
|
exploreKindsMap[exploreKindsKey]?.let { return it }
|
||||||
val kinds = arrayListOf<ExploreKind>()
|
val kinds = arrayListOf<ExploreKind>()
|
||||||
var ruleStr: String = exploreUrl
|
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
kotlin.runCatching {
|
kotlin.runCatching {
|
||||||
|
var ruleStr = exploreUrl
|
||||||
if (exploreUrl.startsWith("<js>", false)
|
if (exploreUrl.startsWith("<js>", false)
|
||||||
|| exploreUrl.startsWith("@js:", false)
|
|| exploreUrl.startsWith("@js:", false)
|
||||||
) {
|
) {
|
||||||
ruleStr = aCache.getAsString(bookSourceUrl) ?: ""
|
ruleStr = aCache.getAsString(exploreKindsKey)
|
||||||
if (ruleStr.isBlank()) {
|
if (ruleStr.isNullOrBlank()) {
|
||||||
val jsStr = if (exploreUrl.startsWith("@")) {
|
val jsStr = if (exploreUrl.startsWith("@")) {
|
||||||
exploreUrl.substring(4)
|
exploreUrl.substring(4)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user