From 5abb3ae53897a7670b6a62b527fef28e8da0327b Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 26 Dec 2018 20:12:55 +0100 Subject: [PATCH] fix #1153, do not show favorite items from hidden folders, when shouldnt --- .../gallery/pro/helpers/MediaFetcher.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 baf207b96..d5978ba84 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 @@ -182,16 +182,16 @@ class MediaFetcher(val context: Context) { ArrayList() } - val files = when (folder) { - FAVORITES -> favoritePaths.map { File(it) }.toTypedArray() - RECYCLE_BIN -> deletedMedia.map { File(it.path) }.toTypedArray() - else -> File(folder).listFiles() ?: return media - } - val doExtraCheck = context.config.doExtraCheck val showHidden = context.config.shouldShowHidden val dateTakens = if (getProperDateTaken) getFolderDateTakens(folder) else HashMap() + val files = when (folder) { + FAVORITES -> favoritePaths.filter { showHidden || !it.contains("/.") }.map { File(it) }.toTypedArray() + RECYCLE_BIN -> deletedMedia.map { File(it.path) }.toTypedArray() + else -> File(folder).listFiles() ?: return media + } + for (file in files) { if (shouldStop) { break