From aa4af8a292e7d714575fa63afc993fdd502a457b Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 24 Apr 2020 14:40:55 +0200 Subject: [PATCH] make folders distinct before checking if they should be visible --- .../com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {