aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java b/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java
index bd7928fd..bba969e4 100644
--- a/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java
+++ b/app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java
@@ -715,15 +715,16 @@ public class MusicDirectory implements Serializable {
Integer lhsTrack = lhs.getTrack();
Integer rhsTrack = rhs.getTrack();
- if(lhsTrack != null && rhsTrack != null && lhsTrack != rhsTrack) {
+ if(lhsTrack == rhsTrack) {
+ return collator.compare(lhs.getTitle(), rhs.getTitle());
+ }
+ if(lhsTrack != null && rhsTrack != null) {
return lhsTrack.compareTo(rhsTrack);
- } else if(lhsTrack != null) {
+ }
+ if(lhsTrack != null) {
return -1;
- } else if(rhsTrack != null) {
- return 1;
}
-
- return collator.compare(lhs.getTitle(), rhs.getTitle());
+ return 1;
}
public static void sort(List<Entry> entries) {