mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
去掉文件格式判断,总有反馈判断错误
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user