fix renamed file leaving trail in media store

This commit is contained in:
Paul Akhamiogu 2022-01-16 23:47:30 +00:00
parent 06b9306331
commit 66b6393b66

View file

@ -841,6 +841,7 @@ fun BaseSimpleActivity.renameFile(
runOnUiThread { runOnUiThread {
callback?.invoke(true, false) callback?.invoke(true, false)
} }
deleteFromMediaStore(oldPath)
scanPathRecursively(newPath) scanPathRecursively(newPath)
} }
} else { } else {
@ -849,6 +850,7 @@ fun BaseSimpleActivity.renameFile(
} }
updateInMediaStore(oldPath, newPath) updateInMediaStore(oldPath, newPath)
scanPathsRecursively(arrayListOf(newPath)) { scanPathsRecursively(arrayListOf(newPath)) {
deleteFromMediaStore(oldPath)
runOnUiThread { runOnUiThread {
callback?.invoke(true, false) callback?.invoke(true, false)
} }