mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
filter wrong directories sooner
This commit is contained in:
parent
e243de95d1
commit
ad8cd557ce
2 changed files with 19 additions and 22 deletions
|
@ -25,9 +25,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
||||||
val parents = context.getParents()
|
val parents = context.getParents()
|
||||||
|
|
||||||
parents.forEach {
|
parents.forEach {
|
||||||
val dir = File(it)
|
val filenames = File(it).list()
|
||||||
if (dir.isDirectory) {
|
|
||||||
val filenames = dir.list()
|
|
||||||
if (filenames?.size ?: 0 > 0) {
|
if (filenames?.size ?: 0 > 0) {
|
||||||
for (filename in filenames) {
|
for (filename in filenames) {
|
||||||
val isImage = filename.isImageFast() || filename.isGif()
|
val isImage = filename.isImageFast() || filename.isGif()
|
||||||
|
@ -53,7 +51,6 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Medium.sorting = fileSorting
|
Medium.sorting = fileSorting
|
||||||
media.sort()
|
media.sort()
|
||||||
|
|
|
@ -68,7 +68,7 @@ fun Context.getParents(): ArrayList<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
val parents = ArrayList<String>()
|
val parents = ArrayList<String>()
|
||||||
parentsSet.mapTo(parents, { it })
|
parentsSet.filterTo(parents, { File(it).isDirectory })
|
||||||
|
|
||||||
if (config.showHiddenFolders) {
|
if (config.showHiddenFolders) {
|
||||||
parents.addAll(getNoMediaFolders())
|
parents.addAll(getNoMediaFolders())
|
||||||
|
|
Loading…
Reference in a new issue