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 03b5ad783..3ecb7fe75 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 @@ -576,7 +576,14 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: val hiddenString = resources.getString(R.string.hidden) filteredDirectories.forEach { - it.name = if (it.path.doesThisOrParentHaveNoMedia(noMediaFolders) && !it.path.isThisOrParentIncluded(includedPaths)) { + val noMediaPath = "${it.path}/.nomedia" + val hasNoMedia = if (folderNoMediaStatuses.keys.contains(noMediaPath)) { + folderNoMediaStatuses[noMediaPath]!! + } else { + it.path.doesThisOrParentHaveNoMedia(noMediaFolders) + } + + it.name = if (hasNoMedia && !it.path.isThisOrParentIncluded(includedPaths)) { "${it.name.removeSuffix(hiddenString).trim()} $hiddenString" } else { it.name.removeSuffix(hiddenString).trim()