make sure hidden folders have "(hidden)" appended

This commit is contained in:
tibbi 2018-05-26 17:04:34 +02:00
parent 70faf7e7cb
commit 527fda18f9

View file

@ -293,6 +293,15 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
} }
}) as ArrayList<Directory> }) as ArrayList<Directory>
val hiddenString = resources.getString(R.string.hidden)
filteredDirectories.forEach {
it.name = if (File(it.path).doesThisOrParentHaveNoMedia() && !it.path.isThisOrParentIncluded(includedPaths)) {
"${it.name.removeSuffix(hiddenString).trim()} $hiddenString"
} else {
it.name
}
}
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>)