From a417a20e114de5113cb2337e707895edd77ad588 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 2 Jun 2018 15:39:37 +0200 Subject: [PATCH] create a list of folders that should be ignored (fake internal storage paths) --- .../com/simplemobiletools/gallery/helpers/MediaFetcher.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt index bb577941c..13e3b826a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/MediaFetcher.kt @@ -97,6 +97,7 @@ class MediaFetcher(val context: Context) { } private fun parseCursor(cursor: Cursor): ArrayList { + val foldersToIgnore = arrayListOf("/storage/emulated/legacy") val config = context.config val includedFolders = config.includedFolders var foldersToScan = ArrayList() @@ -106,7 +107,7 @@ class MediaFetcher(val context: Context) { do { val path = cursor.getStringValue(MediaStore.Images.Media.DATA).trim() val parentPath = File(path).parent?.trimEnd('/') ?: continue - if (!includedFolders.contains(parentPath)) { + if (!includedFolders.contains(parentPath) && !foldersToIgnore.contains(parentPath.toLowerCase())) { foldersToScan.add(parentPath) } } while (cursor.moveToNext())