diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt index 450cc43a9..fe096ba67 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt @@ -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) + } + } } }