fix #837, add an extra check to make sure bin files are restoring properly

This commit is contained in:
tibbi 2018-07-26 13:04:24 +02:00
parent 8d7366d228
commit a8ea2ddbd8
1 changed files with 3 additions and 1 deletions

View File

@ -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!!)
if (File(source).length() == File(destination).length()) {
mediumDao.updateDeleted(destination, 0) mediumDao.updateDeleted(destination, 0)
}
} catch (e: Exception) { } catch (e: Exception) {
showErrorToast(e) showErrorToast(e)
} finally { } finally {