use filesDir absolutePath instead of path in some places

This commit is contained in:
tibbi 2018-07-18 13:24:37 +02:00
parent ec20d67fff
commit 007d972787
2 changed files with 2 additions and 2 deletions

View file

@ -205,7 +205,7 @@ fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList<String>, callback:
var pathsCnt = paths.size var pathsCnt = paths.size
paths.forEach { paths.forEach {
val file = File(it) val file = File(it)
val internalFile = File(filesDir, it) val internalFile = File(filesDir.absolutePath, it)
try { try {
if (file.copyRecursively(internalFile, true)) { if (file.copyRecursively(internalFile, true)) {
mediumDao.updateDeleted(it, System.currentTimeMillis()) mediumDao.updateDeleted(it, System.currentTimeMillis())

View file

@ -402,7 +402,7 @@ fun Context.getFavoritePaths() = galleryDB.MediumDao().getFavoritePaths() as Arr
fun Context.getUpdatedDeletedMedia(mediumDao: MediumDao): ArrayList<Medium> { fun Context.getUpdatedDeletedMedia(mediumDao: MediumDao): ArrayList<Medium> {
val media = mediumDao.getDeletedMedia() as ArrayList<Medium> val media = mediumDao.getDeletedMedia() as ArrayList<Medium>
media.forEach { media.forEach {
it.path = File(filesDir, it.path).toString() it.path = File(filesDir.absolutePath, it.path).toString()
} }
return media return media
} }