mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
make sure we filter out empty folders
This commit is contained in:
@@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user