simplify the hidden folder check

This commit is contained in:
tibbi 2017-02-27 20:04:27 +01:00
parent f372d46b51
commit f82b09470b
1 changed files with 4 additions and 3 deletions

View File

@ -88,10 +88,11 @@ fun Context.getParents(): ArrayList<String> {
} }
private fun isFolderVisible(path: String, noMediaFolders: ArrayList<String>): Boolean { private fun isFolderVisible(path: String, noMediaFolders: ArrayList<String>): Boolean {
val parts = path.split("/") return if (path.contains("/.")) {
return if (parts.any { it.startsWith(".") }) {
false false
} else !noMediaFolders.any { path.startsWith(it) } } else {
!noMediaFolders.any { path.startsWith(it) }
}
} }
fun Context.getNoMediaFolders(): ArrayList<String> { fun Context.getNoMediaFolders(): ArrayList<String> {