filter out symbolic link folders earlier

This commit is contained in:
tibbi 2017-03-17 20:23:46 +01:00
parent aa55dfbb15
commit 07e15db08a
2 changed files with 3 additions and 5 deletions

View file

@ -61,10 +61,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
media.sort()
val directories = groupDirectories(media)
val dirs = ArrayList(directories.values.filter {
val file = File(it.path)
file.exists() && file.canonicalFile == file.absoluteFile // filter out symbolic links too
})
val dirs = ArrayList(directories.values.filter { File(it.path).exists() })
Directory.sorting = config.directorySorting
dirs.sort()

View file

@ -75,7 +75,8 @@ fun Context.getParents(): ArrayList<String> {
}
parentsSet.filterTo(parents, {
if (File(it).isDirectory) {
val file = File(it)
if (file.isDirectory && file.canonicalFile == file.absoluteFile) { // filter out symbolic links too
if (!config.showHiddenFolders) {
isFolderVisible(it, noMediaFolders)
} else