本地书籍无权限则保存到自己选定的文件夹

pull/1486/head
gedoor 3 years ago
parent d3c8530556
commit 020adf45ef
  1. 7
      app/src/main/java/io/legado/app/model/localBook/LocalBook.kt
  2. 1
      app/src/main/java/io/legado/app/model/localBook/TextFile.kt

@ -72,13 +72,6 @@ object LocalBook {
path = uri.toString()
val doc = DocumentFile.fromSingleUri(appCtx, uri)!!
updateTime = doc.lastModified()
val bookFile = cacheFolder.getFile(doc.name!!)
if (!bookFile.exists()) {
bookFile.createNewFile()
doc.readBytes(appCtx).let { bytes ->
bookFile.writeBytes(bytes)
}
}
doc.name!!
} else {
path = uri.path!!

@ -51,7 +51,6 @@ class TextFile(private val book: Book) {
}
}
@Throws(FileNotFoundException::class)
private fun analyze(
bookFd: FileDescriptor,
book: Book,

Loading…
Cancel
Save