Avoid calling doesThisOrParentHaveNoMedia
unnecessarily
This commit is contained in:
parent
3c0c7ed5be
commit
71ef4cece6
1 changed files with 4 additions and 4 deletions
|
@ -702,19 +702,19 @@ fun BaseSimpleActivity.deleteFilesBg(files: List<FileDirItem>, allowDeleteFolder
|
||||||
}
|
}
|
||||||
|
|
||||||
val firstFile = files.first()
|
val firstFile = files.first()
|
||||||
handleSAFDialog(firstFile.path) {
|
val firstFilePath = firstFile.path
|
||||||
|
handleSAFDialog(firstFilePath) {
|
||||||
if (!it) {
|
if (!it) {
|
||||||
return@handleSAFDialog
|
return@handleSAFDialog
|
||||||
}
|
}
|
||||||
|
|
||||||
checkManageMediaOrHandleSAFDialogSdk30(firstFile.path) {
|
checkManageMediaOrHandleSAFDialogSdk30(firstFilePath) {
|
||||||
if (!it) {
|
if (!it) {
|
||||||
return@checkManageMediaOrHandleSAFDialogSdk30
|
return@checkManageMediaOrHandleSAFDialogSdk30
|
||||||
}
|
}
|
||||||
|
|
||||||
val recycleBinPath = firstFile.isRecycleBinPath(this)
|
val recycleBinPath = firstFile.isRecycleBinPath(this)
|
||||||
val containsNoMedia = firstFile.path.doesThisOrParentHaveNoMedia(HashMap(), null)
|
if (canManageMedia() && !recycleBinPath && !firstFilePath.doesThisOrParentHaveNoMedia(HashMap(), null)) {
|
||||||
if (canManageMedia() && !recycleBinPath && !containsNoMedia) {
|
|
||||||
val fileUris = getFileUrisFromFileDirItems(files)
|
val fileUris = getFileUrisFromFileDirItems(files)
|
||||||
|
|
||||||
deleteSDK30Uris(fileUris) { success ->
|
deleteSDK30Uris(fileUris) { success ->
|
||||||
|
|
Loading…
Reference in a new issue