From f6306574d4597a2180fdfaa24ddce03ea78238f4 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 6 Apr 2022 20:19:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=96=87=E4=BB=B6=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=88=A4=E6=96=AD,=E6=80=BB=E6=9C=89=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/association/FileAssociationViewModel.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt b/app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt index 3726127ff..47e72ae87 100644 --- a/app/src/main/java/io/legado/app/ui/association/FileAssociationViewModel.kt +++ b/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)