fix #765, avoid showing hidden items when inappropriate at Show All Folders

This commit is contained in:
tibbi 2018-05-12 23:55:40 +02:00
parent ca02223ab6
commit 1b474d66f3

View file

@ -289,7 +289,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
val shouldShowHidden = config.shouldShowHidden val shouldShowHidden = config.shouldShowHidden
var filteredMedia = media var filteredMedia = media
if (!shouldShowHidden) { if (!shouldShowHidden) {
filteredMedia = media.filter { !it.name.startsWith('.') } as ArrayList<Medium> filteredMedia = media.filter { !it.path.contains("/.") } as ArrayList<Medium>
} }
val filterMedia = config.filterMedia val filterMedia = config.filterMedia
@ -303,6 +303,9 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
} }
}) as ArrayList<Medium> }) as ArrayList<Medium>
Medium.sorting = config.getFileSorting(path)
filteredMedia.sort()
callback(filteredMedia) callback(filteredMedia)
media.filter { !getDoesFilePathExist(it.path) }.forEach { media.filter { !getDoesFilePathExist(it.path) }.forEach {
mediumDao.deleteMediumPath(it.path) mediumDao.deleteMediumPath(it.path)