diff --git a/app/src/main/java/io/legado/app/constant/AppLog.kt b/app/src/main/java/io/legado/app/constant/AppLog.kt index 75311752a..e4d6c2911 100644 --- a/app/src/main/java/io/legado/app/constant/AppLog.kt +++ b/app/src/main/java/io/legado/app/constant/AppLog.kt @@ -31,7 +31,7 @@ object AppLog { } fun putDebug(message: String?, throwable: Throwable? = null) { - if (AppConfig.recordLog) { + if (AppConfig.recordLog || BuildConfig.DEBUG) { put(message, throwable) } } diff --git a/app/src/main/java/io/legado/app/data/entities/Book.kt b/app/src/main/java/io/legado/app/data/entities/Book.kt index 568778d14..e042d2525 100644 --- a/app/src/main/java/io/legado/app/data/entities/Book.kt +++ b/app/src/main/java/io/legado/app/data/entities/Book.kt @@ -193,7 +193,14 @@ data class Book( } fun getUseReplaceRule(): Boolean { - return config.useReplaceRule ?: AppConfig.replaceEnableDefault + val useReplaceRule = config.useReplaceRule + if (useReplaceRule != null) { + return useReplaceRule + } + if (type == BookType.image) { + return false + } + return AppConfig.replaceEnableDefault } fun setReSegment(reSegment: Boolean) { diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index dfb7b5193..7e68c778c 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -1,5 +1,6 @@ package io.legado.app.help +import io.legado.app.constant.AppLog import io.legado.app.constant.AppPattern import io.legado.app.constant.EventBus import io.legado.app.data.appDb @@ -126,7 +127,7 @@ object BookHelp { ).writeBytes(it) } } catch (e: Exception) { - e.printOnDebug() + AppLog.putDebug("${src}下载错误", e) } finally { downloadImages.remove(src) }