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