优化
This commit is contained in:
@@ -86,7 +86,11 @@ class ImportBookViewModel(application: Application) : BaseViewModel(application)
|
||||
fun addToBookshelf(uriList: HashSet<String>, finally: () -> Unit) {
|
||||
execute {
|
||||
val fileUris = uriList.map {
|
||||
Uri.parse(it)
|
||||
if (it.isContentScheme()) {
|
||||
Uri.parse(it)
|
||||
} else {
|
||||
Uri.fromFile(File(it))
|
||||
}
|
||||
}
|
||||
LocalBook.importFiles(fileUris)
|
||||
}.onError {
|
||||
|
||||
@@ -82,7 +82,7 @@ object RealPathUtil {
|
||||
} else if ("file".equals(uri.scheme, ignoreCase = true)) {
|
||||
return uri.path
|
||||
}
|
||||
return null
|
||||
return uri.path
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user