Rescan path after deleting .nomedia
This commit is contained in:
parent
05adf8a627
commit
f49348d86d
1 changed files with 9 additions and 2 deletions
|
@ -253,9 +253,16 @@ 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 ->
|
||||||
|
if (needsRescan) {
|
||||||
|
rescanAndDeletePath(path) {
|
||||||
rescanFolderMedia(path)
|
rescanFolderMedia(path)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
rescanFolderMedia(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun BaseSimpleActivity.toggleFileVisibility(oldPath: String, hide: Boolean, callback: ((newPath: String) -> Unit)? = null) {
|
fun BaseSimpleActivity.toggleFileVisibility(oldPath: String, hide: Boolean, callback: ((newPath: String) -> Unit)? = null) {
|
||||||
|
|
Loading…
Reference in a new issue