sort media/directories by path, if the original sorting result is equal

This commit is contained in:
tibbi 2018-12-17 14:43:32 +01:00
parent 96d839cd8c
commit 944372deda
2 changed files with 8 additions and 0 deletions

View File

@ -170,6 +170,10 @@ fun Context.getSortedDirectories(source: ArrayList<Directory>): ArrayList<Direct
else -> o1.taken.compareTo(o2.taken) else -> o1.taken.compareTo(o2.taken)
} }
if (result == 0) {
result = AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase())
}
if (sorting and SORT_DESCENDING != 0) { if (sorting and SORT_DESCENDING != 0) {
result *= -1 result *= -1
} }

View File

@ -364,6 +364,10 @@ class MediaFetcher(val context: Context) {
else -> o1.taken.compareTo(o2.taken) else -> o1.taken.compareTo(o2.taken)
} }
if (result == 0) {
result = AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase())
}
if (sorting and SORT_DESCENDING != 0) { if (sorting and SORT_DESCENDING != 0) {
result *= -1 result *= -1
} }