avoid checking cached folders hidden status unnecessarily
This commit is contained in:
parent
a393e2afb6
commit
e59c061972
1 changed files with 14 additions and 12 deletions
|
@ -575,6 +575,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
|
||||||
}
|
}
|
||||||
}) as ArrayList<Directory>
|
}) as ArrayList<Directory>
|
||||||
|
|
||||||
|
if (shouldShowHidden) {
|
||||||
val hiddenString = resources.getString(R.string.hidden)
|
val hiddenString = resources.getString(R.string.hidden)
|
||||||
filteredDirectories.forEach {
|
filteredDirectories.forEach {
|
||||||
val noMediaPath = "${it.path}/.nomedia"
|
val noMediaPath = "${it.path}/.nomedia"
|
||||||
|
@ -590,6 +591,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
|
||||||
it.name.removeSuffix(hiddenString).trim()
|
it.name.removeSuffix(hiddenString).trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val clone = filteredDirectories.clone() as ArrayList<Directory>
|
val clone = filteredDirectories.clone() as ArrayList<Directory>
|
||||||
callback(clone.distinctBy { it.path.getDistinctPath() } as ArrayList<Directory>)
|
callback(clone.distinctBy { it.path.getDistinctPath() } as ArrayList<Directory>)
|
||||||
|
|
Loading…
Reference in a new issue