Rescan path after deleting .nomedia

This commit is contained in:
Naveen 2023-03-12 21:49:04 +05:30
parent 05adf8a627
commit f49348d86d

View file

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