aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormvn23 <schopdiedwaas@gmail.com>2022-06-27 16:08:00 +0200
committermvn23 <schopdiedwaas@gmail.com>2022-06-27 16:08:00 +0200
commitb17f6a4ab67247045a6de59c21f8c6983c7691c5 (patch)
tree8f18a533b45d0f81865c4cc90c47e7c1395885ee
parenta83b480aa4167a35b29935ddb1c0eb33da6d3f3c (diff)
downloaddsub-b17f6a4ab67247045a6de59c21f8c6983c7691c5.tar.gz
dsub-b17f6a4ab67247045a6de59c21f8c6983c7691c5.tar.bz2
dsub-b17f6a4ab67247045a6de59c21f8c6983c7691c5.zip
Fix album sort with duplicate track numbers
-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) {