mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-27 06:57:59 +01:00
make sure we filter out empty folders
This commit is contained in:
parent
db278b4aa2
commit
d2e2e315e1
1 changed files with 6 additions and 0 deletions
|
@ -759,6 +759,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
dirs.forEach {
|
dirs.forEach {
|
||||||
if (!getDoesFilePathExist(it.path)) {
|
if (!getDoesFilePathExist(it.path)) {
|
||||||
invalidDirs.add(it)
|
invalidDirs.add(it)
|
||||||
|
} else {
|
||||||
|
val children = File(it.path).list()
|
||||||
|
val hasMediaFile = children?.any { it.isImageVideoGif() } ?: false
|
||||||
|
if (!hasMediaFile) {
|
||||||
|
invalidDirs.add(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue