From 876e10a2027d9254a03f969573d6b5f0e557aa6a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 18 Jan 2021 12:29:52 +0100 Subject: [PATCH] prefill nomedia folders after fetching --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 4650b2b90..064e5cab1 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 @@ -553,8 +553,12 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: val excludedPaths = config.excludedFolders val includedPaths = config.includedFolders - val noMediaFolders = getNoMediaFoldersSync() val folderNoMediaStatuses = HashMap() + val noMediaFolders = getNoMediaFoldersSync() + noMediaFolders.forEach { folder -> + folderNoMediaStatuses[folder] = true + } + var filteredDirectories = directories.filter { it.path.shouldFolderBeVisible(excludedPaths, includedPaths, shouldShowHidden, folderNoMediaStatuses, noMediaFolders) { path, hasNoMedia -> folderNoMediaStatuses[path] = hasNoMedia