diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index f5fb3572d..bffcdcfc6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -516,7 +516,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: val shouldShowHidden = config.shouldShowHidden || forceShowHidden val excludedPaths = config.excludedFolders val includedPaths = config.includedFolders - var filteredDirectories = directories.filter { it.path.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden, this) } as ArrayList + var filteredDirectories = directories.filter { it.path.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden) } as ArrayList val filterMedia = config.filterMedia filteredDirectories = (when { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt index 3f36fa99e..cf5260e4a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/String.kt @@ -1,6 +1,5 @@ package com.simplemobiletools.gallery.pro.extensions -import android.content.Context import android.os.Environment import com.simplemobiletools.commons.extensions.containsNoMedia import com.simplemobiletools.commons.extensions.doesParentHaveNoMedia @@ -11,7 +10,7 @@ fun String.isThisOrParentIncluded(includedPaths: MutableSet) = includedP fun String.isThisOrParentExcluded(excludedPaths: MutableSet) = excludedPaths.any { equals(it, true) } || excludedPaths.any { "$this/".startsWith("$it/", true) } -fun String.shouldFolderBeVisible(excludedPaths: MutableSet, includedPaths: MutableSet, showHidden: Boolean, context: Context): Boolean { +fun String.shouldFolderBeVisible(excludedPaths: MutableSet, includedPaths: MutableSet, showHidden: Boolean): Boolean { if (isEmpty()) { return false } 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 7822da75f..791b8e46a 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 @@ -67,7 +67,7 @@ class MediaFetcher(val context: Context) { val excludedPaths = config.excludedFolders val includedPaths = config.includedFolders folders.distinctBy { it.getDistinctPath() } - .filter { it.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden, context) }.toMutableList() as ArrayList + .filter { it.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden) }.toMutableList() as ArrayList } catch (e: Exception) { ArrayList() }