mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
6433bf1f2e
commit
f0ee3e41ba
@ -107,6 +107,14 @@ class FileAssociationActivity :
|
||||
val name = bookDoc?.name!!
|
||||
val doc = treeDoc!!.findFile(name)
|
||||
if (doc != null) {
|
||||
if (bookDoc.lastModified() > doc.lastModified()) {
|
||||
contentResolver.openOutputStream(doc.uri)!!.use { oStream ->
|
||||
contentResolver.openInputStream(bookDoc.uri)!!.use { iStream ->
|
||||
iStream.copyTo(oStream)
|
||||
oStream.flush()
|
||||
}
|
||||
}
|
||||
}
|
||||
viewModel.importBook(doc.uri)
|
||||
} else {
|
||||
val nDoc = treeDoc.createFile(FileUtils.getMimeType(name), name)!!
|
||||
|
Loading…
Reference in New Issue
Block a user