update the medium comparison function, allow result 0
This commit is contained in:
parent
75adc50906
commit
66221ff82d
1 changed files with 12 additions and 2 deletions
|
@ -19,9 +19,19 @@ class Medium(val name: String, var path: String, val isVideo: Boolean, val times
|
||||||
if (sorting and SORT_BY_NAME != 0) {
|
if (sorting and SORT_BY_NAME != 0) {
|
||||||
res = name.toLowerCase().compareTo(other.name.toLowerCase())
|
res = name.toLowerCase().compareTo(other.name.toLowerCase())
|
||||||
} else if (sorting and SORT_BY_DATE != 0) {
|
} else if (sorting and SORT_BY_DATE != 0) {
|
||||||
res = if (timestamp > other.timestamp) 1 else -1
|
res = if (timestamp == other.timestamp)
|
||||||
|
0
|
||||||
|
else if (timestamp > other.timestamp)
|
||||||
|
1
|
||||||
|
else
|
||||||
|
-1
|
||||||
} else {
|
} else {
|
||||||
res = if (size > other.size) 1 else -1
|
res = if (size == other.size)
|
||||||
|
0
|
||||||
|
else if (size > other.size)
|
||||||
|
1
|
||||||
|
else
|
||||||
|
-1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sorting and SORT_DESCENDING != 0) {
|
if (sorting and SORT_DESCENDING != 0) {
|
||||||
|
|
Loading…
Reference in a new issue