优化
This commit is contained in:
1 parent
4206359fce
commit
c5c5c6352a
2 files changed
+6
-2
No files matched your search
@@ -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