make sure we filter out empty folders

This commit is contained in:
tibbi 2018-04-26 10:35:32 +02:00
parent db278b4aa2
commit d2e2e315e1

View file

@ -759,6 +759,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
dirs.forEach {
if (!getDoesFilePathExist(it.path)) {
invalidDirs.add(it)
} else {
val children = File(it.path).list()
val hasMediaFile = children?.any { it.isImageVideoGif() } ?: false
if (!hasMediaFile) {
invalidDirs.add(it)
}
}
}