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
1 changed files with 9 additions and 2 deletions

View File

@ -253,8 +253,15 @@ fun BaseSimpleActivity.removeNoMedia(path: String, callback: (() -> Unit)? = nul
tryDeleteFileDirItem(file.toFileDirItem(applicationContext), false, false) {
callback?.invoke()
deleteFromMediaStore(file.absolutePath)
rescanFolderMedia(path)
deleteFromMediaStore(file.absolutePath) { needsRescan ->
if (needsRescan) {
rescanAndDeletePath(path) {
rescanFolderMedia(path)
}
} else {
rescanFolderMedia(path)
}
}
}
}