pull/1343/head
gedoor 3 years ago
parent c17c106dbd
commit b26abad065
  1. 3
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt
  2. 4
      app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt
  3. 4
      app/src/main/java/io/legado/app/model/webBook/BookContent.kt
  4. 3
      app/src/main/java/io/legado/app/model/webBook/BookInfo.kt
  5. 3
      app/src/main/java/io/legado/app/model/webBook/BookList.kt
  6. 1
      app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt

@ -401,8 +401,7 @@ object ReadBookConfig {
} }
if (config.bgTypeEInk == 2) { if (config.bgTypeEInk == 2) {
val bgName = FileUtils.getName(config.bgStrEInk) val bgName = FileUtils.getName(config.bgStrEInk)
@Suppress("BlockingMethodInNonBlockingContext") val bgPath = val bgPath = FileUtils.getPath(appCtx.externalFiles, "bg", bgName)
FileUtils.getPath(appCtx.externalFiles, "bg", bgName)
if (!FileUtils.exist(bgPath)) { if (!FileUtils.exist(bgPath)) {
val bgFile = FileUtils.getFile(configDir, bgName) val bgFile = FileUtils.getFile(configDir, bgName)
if (bgFile.exists()) { if (bgFile.exists()) {

@ -18,7 +18,9 @@ import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import splitties.init.appCtx import splitties.init.appCtx
@Suppress("BlockingMethodInNonBlockingContext") /**
* 获取目录
*/
object BookChapterList { object BookChapterList {
private val falseRegex = "\\s*(?i)(null|false|0)\\s*".toRegex() private val falseRegex = "\\s*(?i)(null|false|0)\\s*".toRegex()

@ -21,7 +21,9 @@ import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import splitties.init.appCtx import splitties.init.appCtx
@Suppress("BlockingMethodInNonBlockingContext") /**
* 获取正文
*/
object BookContent { object BookContent {
@Throws(Exception::class) @Throws(Exception::class)

@ -14,6 +14,9 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ensureActive import kotlinx.coroutines.ensureActive
import splitties.init.appCtx import splitties.init.appCtx
/**
* 获取详情
*/
object BookInfo { object BookInfo {
@Throws(Exception::class) @Throws(Exception::class)

@ -17,6 +17,9 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ensureActive import kotlinx.coroutines.ensureActive
import splitties.init.appCtx import splitties.init.appCtx
/**
* 获取书籍列表
*/
object BookList { object BookList {
@Throws(Exception::class) @Throws(Exception::class)

@ -20,7 +20,6 @@ class FileAssociationViewModel(application: Application) : BaseViewModel(applica
val openBookLiveData = MutableLiveData<String>() val openBookLiveData = MutableLiveData<String>()
val errorLiveData = MutableLiveData<String>() val errorLiveData = MutableLiveData<String>()
@Suppress("BlockingMethodInNonBlockingContext")
fun dispatchIndent(uri: Uri) { fun dispatchIndent(uri: Uri) {
execute { execute {
//如果是普通的url,需要根据返回的内容判断是什么 //如果是普通的url,需要根据返回的内容判断是什么

Loading…
Cancel
Save