do not add the excluded folders into everShownFolders
This commit is contained in:
parent
bf600a2fe4
commit
9e7350da16
1 changed files with 16 additions and 7 deletions
|
@ -1056,21 +1056,30 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
directories_refresh_layout.isRefreshing = false
|
directories_refresh_layout.isRefreshing = false
|
||||||
checkPlaceholderVisibility(dirs)
|
checkPlaceholderVisibility(dirs)
|
||||||
}
|
}
|
||||||
checkInvalidDirectories(dirs)
|
|
||||||
|
|
||||||
val everShownFolders = config.everShownFolders as HashSet
|
checkInvalidDirectories(dirs)
|
||||||
dirs.mapTo(everShownFolders) { it.path }
|
if (mDirs.size > 50) {
|
||||||
|
excludeSpamFolders()
|
||||||
|
}
|
||||||
|
|
||||||
|
val excludedFolders = config.excludedFolders
|
||||||
|
val everShownFolders = HashSet<String>()
|
||||||
|
|
||||||
|
// do not add excluded folders and their subfolders at everShownFolders
|
||||||
|
dirs.filter { dir ->
|
||||||
|
if (excludedFolders.any { dir.path.startsWith(it) }) {
|
||||||
|
return@filter false
|
||||||
|
}
|
||||||
|
return@filter true
|
||||||
|
}.mapTo(everShownFolders) { it.path }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// catch some extreme exceptions like too many everShownFolders for storing, shouldnt really happen
|
||||||
config.everShownFolders = everShownFolders
|
config.everShownFolders = everShownFolders
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
config.everShownFolders = HashSet()
|
config.everShownFolders = HashSet()
|
||||||
}
|
}
|
||||||
mDirs = dirs.clone() as ArrayList<Directory>
|
mDirs = dirs.clone() as ArrayList<Directory>
|
||||||
|
|
||||||
if (mDirs.size > 55) {
|
|
||||||
excludeSpamFolders()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkPlaceholderVisibility(dirs: ArrayList<Directory>) {
|
private fun checkPlaceholderVisibility(dirs: ArrayList<Directory>) {
|
||||||
|
|
Loading…
Reference in a new issue