make folders distinct before checking if they should be visible

This commit is contained in:
tibbi 2020-04-24 14:40:55 +02:00
parent 26e96418b6
commit aa4af8a292
1 changed files with 2 additions and 2 deletions

View File

@ -192,8 +192,8 @@ class MediaFetcher(val context: Context) {
val showHidden = config.shouldShowHidden val showHidden = config.shouldShowHidden
val excludedFolders = config.excludedFolders val excludedFolders = config.excludedFolders
foldersToScan = foldersToScan.filter { it.shouldFolderBeVisible(excludedFolders, includedFolders, showHidden, context) }.toHashSet() return foldersToScan.distinctBy { it.getDistinctPath() }
return foldersToScan.distinctBy { it.getDistinctPath() }.toMutableSet() as LinkedHashSet<String> .filter { it.shouldFolderBeVisible(excludedFolders, includedFolders, showHidden, context) }.toMutableSet() as LinkedHashSet<String>
} }
private fun addFolder(curFolders: HashSet<String>, folder: String) { private fun addFolder(curFolders: HashSet<String>, folder: String) {