去掉文件格式判断,总有反馈判断错误

pull/1758/head
kunfei 3 years ago
parent 3aed980f5e
commit f6306574d4
  1. 8
      app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt

@ -4,7 +4,6 @@ import android.app.Application
import android.net.Uri
import androidx.documentfile.provider.DocumentFile
import androidx.lifecycle.MutableLiveData
import io.legado.app.constant.AppPattern.bookFileRegex
import io.legado.app.exception.NoStackTraceException
import io.legado.app.model.localBook.LocalBook
import io.legado.app.utils.isJson
@ -47,12 +46,7 @@ class FileAssociationViewModel(application: Application) : BaseAssociationViewMo
importHttpTTS(content, finally)
else -> errorLiveData.postValue("格式不对")
}
(uri.path ?: uri.toString()).matches(bookFileRegex) -> {
importBookLiveData.postValue(uri)
}
else -> {
throw NoStackTraceException("暂未支持的本地书籍格式(TXT/UMD/EPUB)")
}
else -> importBookLiveData.postValue(uri)
}
} else {
onLineImportLive.postValue(uri)

Loading…
Cancel
Save