diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index ed11d0fe2..ddf73d713 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -192,8 +192,8 @@ class MediaFetcher(val context: Context) { val showHidden = config.shouldShowHidden val excludedFolders = config.excludedFolders - foldersToScan = foldersToScan.filter { it.shouldFolderBeVisible(excludedFolders, includedFolders, showHidden, context) }.toHashSet() - return foldersToScan.distinctBy { it.getDistinctPath() }.toMutableSet() as LinkedHashSet + return foldersToScan.distinctBy { it.getDistinctPath() } + .filter { it.shouldFolderBeVisible(excludedFolders, includedFolders, showHidden, context) }.toMutableSet() as LinkedHashSet } private fun addFolder(curFolders: HashSet, folder: String) {