Merge pull request #2800 from Naveen3Singh/fix_no_media_deletion

Fix deleting hidden files
This commit is contained in:
Tibor Kaputa 2023-03-15 12:42:00 +01:00 committed by GitHub
commit 2da6302775
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -253,9 +253,16 @@ fun BaseSimpleActivity.removeNoMedia(path: String, callback: (() -> Unit)? = nul
tryDeleteFileDirItem(file.toFileDirItem(applicationContext), false, false) {
callback?.invoke()
deleteFromMediaStore(file.absolutePath)
deleteFromMediaStore(file.absolutePath) { needsRescan ->
if (needsRescan) {
rescanAndDeletePath(path) {
rescanFolderMedia(path)
}
} else {
rescanFolderMedia(path)
}
}
}
}
fun BaseSimpleActivity.toggleFileVisibility(oldPath: String, hide: Boolean, callback: ((newPath: String) -> Unit)? = null) {