use parent path at folder sorting

This commit is contained in:
tibbi 2020-02-11 10:06:53 +01:00
parent 4b6da9811b
commit a385be80a8

View file

@ -887,7 +887,7 @@ fun Context.getDirectorySortingValue(media: ArrayList<Medium>, path: String, nam
val sorting = config.directorySorting val sorting = config.directorySorting
val sorted = when { val sorted = when {
sorting and SORT_BY_NAME != 0 -> return name sorting and SORT_BY_NAME != 0 -> return name
sorting and SORT_BY_PATH != 0 -> return path sorting and SORT_BY_PATH != 0 -> return path.getParentPath()
sorting and SORT_BY_SIZE != 0 -> return size.toString() sorting and SORT_BY_SIZE != 0 -> return size.toString()
sorting and SORT_BY_DATE_MODIFIED != 0 -> media.sortedBy { it.modified } sorting and SORT_BY_DATE_MODIFIED != 0 -> media.sortedBy { it.modified }
sorting and SORT_BY_DATE_TAKEN != 0 -> media.sortedBy { it.taken } sorting and SORT_BY_DATE_TAKEN != 0 -> media.sortedBy { it.taken }