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 c465a9c5e..0a70c6a61 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -289,7 +289,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag val shouldShowHidden = config.shouldShowHidden var filteredMedia = media if (!shouldShowHidden) { - filteredMedia = media.filter { !it.name.startsWith('.') } as ArrayList + filteredMedia = media.filter { !it.path.contains("/.") } as ArrayList } val filterMedia = config.filterMedia @@ -303,6 +303,9 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag } }) as ArrayList + Medium.sorting = config.getFileSorting(path) + filteredMedia.sort() + callback(filteredMedia) media.filter { !getDoesFilePathExist(it.path) }.forEach { mediumDao.deleteMediumPath(it.path)