move folder distinction check further

This commit is contained in:
tibbi 2020-09-09 22:54:22 +02:00
parent f38981be7b
commit 164518bb80

View file

@ -66,7 +66,8 @@ class MediaFetcher(val context: Context) {
val shouldShowHidden = config.shouldShowHidden
val excludedPaths = config.excludedFolders
val includedPaths = config.includedFolders
folders.filter { it.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden, context) }.toMutableList() as ArrayList<String>
folders.distinctBy { it.getDistinctPath() }
.filter { it.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden, context) }.toMutableList() as ArrayList<String>
} catch (e: Exception) {
ArrayList()
}
@ -190,7 +191,7 @@ class MediaFetcher(val context: Context) {
addFolder(foldersToScan, it)
}
return foldersToScan.distinctBy { it.getDistinctPath() }.toMutableSet() as LinkedHashSet<String>
return foldersToScan.toMutableSet() as LinkedHashSet<String>
}
private fun addFolder(curFolders: HashSet<String>, folder: String) {