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 ccfaa425b..2c0420b9a 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 @@ -7,9 +7,9 @@ import com.simplemobiletools.commons.helpers.NOMEDIA import java.io.File import java.io.IOException -fun String.isThisOrParentIncluded(includedPaths: MutableSet) = includedPaths.any { startsWith(it, true) } +fun String.isThisOrParentIncluded(includedPaths: MutableSet) = includedPaths.any { equals(it, true) } || includedPaths.any { "$this/".startsWith("$it/", true) } -fun String.isThisOrParentExcluded(excludedPaths: MutableSet) = excludedPaths.any { startsWith(it, true) } +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): Boolean { if (isEmpty()) {