From bac9bf57b1fc6c56cd9e86f70275c8db873925f2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Sep 2019 10:49:54 +0200 Subject: [PATCH] properly retrieve cached portrait photos --- .../simplemobiletools/gallery/pro/extensions/Context.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 86bd21488..0412fd4ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -619,6 +619,15 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag media.addAll(getUpdatedDeletedMedia(mediumDao)) } + if (config.filterMedia and TYPE_PORTRAITS != 0) { + for (folder in foldersToScan) { + val allFiles = File(folder).listFiles() ?: continue + allFiles.filter { it.isDirectory && it.name.startsWith("img_", true) }.forEach { + foldersToScan.add(it.absolutePath) + } + } + } + val shouldShowHidden = config.shouldShowHidden foldersToScan.filter { path.isNotEmpty() || !config.isFolderProtected(it) }.forEach { try {