From c242f74f9b41a9aab09232064cb7e6cca7b8285c Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 25 Sep 2017 22:55:22 +0200 Subject: [PATCH] fix some glitches with incasesensitive paths at directories --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 604822008..d6054eb74 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -34,9 +34,11 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va val directories = groupDirectories(media) val removePaths = ArrayList() - directories.keys.forEach { - if (!File(it).exists() || !shouldFolderBeVisible(it, excludedPaths, includedPaths)) { - removePaths.add(it) + for ((path, curMedia) in directories) { + // make sure the path has uppercase letters wherever appropriate + val groupPath = File(curMedia.first().path).parent + if (!File(groupPath).exists() || !shouldFolderBeVisible(groupPath, excludedPaths, includedPaths)) { + removePaths.add(groupPath) } } @@ -66,7 +68,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va else -> parentDir.getFilenameFromPath() } - if (File(path).containsNoMedia()) { + if (File(parentDir).containsNoMedia()) { dirName += " $hidden" }