mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-12-02 09:18:00 +01:00
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,19 +575,21 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
|
||||||
}
|
}
|
||||||
}) as ArrayList<Directory>
|
}) as ArrayList<Directory>
|
||||||
|
|
||||||
val hiddenString = resources.getString(R.string.hidden)
|
if (shouldShowHidden) {
|
||||||
filteredDirectories.forEach {
|
val hiddenString = resources.getString(R.string.hidden)
|
||||||
val noMediaPath = "${it.path}/.nomedia"
|
filteredDirectories.forEach {
|
||||||
val hasNoMedia = if (folderNoMediaStatuses.keys.contains(noMediaPath)) {
|
val noMediaPath = "${it.path}/.nomedia"
|
||||||
folderNoMediaStatuses[noMediaPath]!!
|
val hasNoMedia = if (folderNoMediaStatuses.keys.contains(noMediaPath)) {
|
||||||
} else {
|
folderNoMediaStatuses[noMediaPath]!!
|
||||||
it.path.doesThisOrParentHaveNoMedia(noMediaFolders)
|
} else {
|
||||||
}
|
it.path.doesThisOrParentHaveNoMedia(noMediaFolders)
|
||||||
|
}
|
||||||
|
|
||||||
it.name = if (hasNoMedia && !it.path.isThisOrParentIncluded(includedPaths)) {
|
it.name = if (hasNoMedia && !it.path.isThisOrParentIncluded(includedPaths)) {
|
||||||
"${it.name.removeSuffix(hiddenString).trim()} $hiddenString"
|
"${it.name.removeSuffix(hiddenString).trim()} $hiddenString"
|
||||||
} else {
|
} else {
|
||||||
it.name.removeSuffix(hiddenString).trim()
|
it.name.removeSuffix(hiddenString).trim()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue