From d4a8560d2cfed3f88d5c741592b4d8c0199127a4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 21 May 2017 12:58:07 +0200 Subject: [PATCH] add some more conditions to folder visibility checking --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 61ea88362..3b4ed44d1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -70,7 +70,9 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va } private fun shouldFolderBeVisible(path: String, excludedPaths: MutableSet): Boolean { - return isThisOrParentExcluded(path, excludedPaths) || (!config.shouldShowHidden && File(path).containsNoMedia()) + val file = File(path) + return isThisOrParentExcluded(path, excludedPaths) || (!config.shouldShowHidden && file.isDirectory && + file.canonicalFile == file.absoluteFile && file.containsNoMedia()) } private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet) = excludedPaths.any { path.startsWith(it) }