This commit is contained in:
kunfei
2023-03-24 14:59:25 +08:00
parent 4206359fce
commit c5c5c6352a
2 changed files with 6 additions and 2 deletions
@@ -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
}
/**