diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt index 783792998..22b8b7ec9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -292,6 +292,16 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag filteredMedia = media.filter { !it.path.contains("/.") } as ArrayList } + if (path == "/") { + val excludedFolders = config.excludedFolders + filteredMedia = filteredMedia.filter { + val mediumPath = it.path + excludedFolders.none { + mediumPath.startsWith(it, true) + } + } as ArrayList + } + val filterMedia = config.filterMedia filteredMedia = (when { getVideosOnly -> filteredMedia.filter { it.type == TYPE_VIDEOS } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt index 6d8c217a1..ce5777efa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -24,7 +24,7 @@ data class Directory( companion object { private const val serialVersionUID = -6553345863555455L - var sorting: Int = 0 + var sorting = 0 } override fun compareTo(other: Directory): Int {