Merge pull request #1639 from Naveen3Singh/fix_no_media_deletion

Delete hidden files using casual method
This commit is contained in:
Tibor Kaputa 2023-03-13 08:49:44 +01:00 committed by GitHub
commit 136962b0cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -702,18 +702,19 @@ fun BaseSimpleActivity.deleteFilesBg(files: List<FileDirItem>, allowDeleteFolder
}
val firstFile = files.first()
handleSAFDialog(firstFile.path) {
val firstFilePath = firstFile.path
handleSAFDialog(firstFilePath) {
if (!it) {
return@handleSAFDialog
}
checkManageMediaOrHandleSAFDialogSdk30(firstFile.path) {
checkManageMediaOrHandleSAFDialogSdk30(firstFilePath) {
if (!it) {
return@checkManageMediaOrHandleSAFDialogSdk30
}
val recycleBinPath = firstFile.isRecycleBinPath(this)
if (canManageMedia() && !recycleBinPath) {
if (canManageMedia() && !recycleBinPath && !firstFilePath.doesThisOrParentHaveNoMedia(HashMap(), null)) {
val fileUris = getFileUrisFromFileDirItems(files)
deleteSDK30Uris(fileUris) { success ->