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
1 changed files with 4 additions and 1 deletions

View File

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