fix #837, add an extra check to make sure bin files are restoring properly
This commit is contained in:
parent
8d7366d228
commit
a8ea2ddbd8
1 changed files with 3 additions and 1 deletions
|
@ -236,7 +236,9 @@ fun BaseSimpleActivity.restoreRecycleBinPaths(paths: ArrayList<String>, callback
|
||||||
out = getFileOutputStreamSync(destination, source.getMimeType())
|
out = getFileOutputStreamSync(destination, source.getMimeType())
|
||||||
inputStream = getFileInputStreamSync(source)!!
|
inputStream = getFileInputStreamSync(source)!!
|
||||||
inputStream.copyTo(out!!)
|
inputStream.copyTo(out!!)
|
||||||
mediumDao.updateDeleted(destination, 0)
|
if (File(source).length() == File(destination).length()) {
|
||||||
|
mediumDao.updateDeleted(destination, 0)
|
||||||
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
showErrorToast(e)
|
showErrorToast(e)
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in a new issue