mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
avoid checking cached folders hidden status unnecessarily
This commit is contained in:
@ -575,6 +575,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
|
||||
}
|
||||
}) as ArrayList<Directory>
|
||||
|
||||
if (shouldShowHidden) {
|
||||
val hiddenString = resources.getString(R.string.hidden)
|
||||
filteredDirectories.forEach {
|
||||
val noMediaPath = "${it.path}/.nomedia"
|
||||
@ -590,6 +591,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
|
||||
it.name.removeSuffix(hiddenString).trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val clone = filteredDirectories.clone() as ArrayList<Directory>
|
||||
callback(clone.distinctBy { it.path.getDistinctPath() } as ArrayList<Directory>)
|
||||
|
Reference in New Issue
Block a user