aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@users.noreply.github.com>2022-07-12 16:05:50 -0700
committerGitHub <noreply@github.com>2022-07-12 16:05:50 -0700
commitd8d8b04d7d60717c16b778ebbb26ec63752ada25 (patch)
treef16cebc38b6f0ba467503651fdc84d27f78720db /app
parenta83b480aa4167a35b29935ddb1c0eb33da6d3f3c (diff)
parent21d7135cb4c1a595be8c8b73f67b5ed9345909cd (diff)
downloaddsub-d8d8b04d7d60717c16b778ebbb26ec63752ada25.tar.gz
dsub-d8d8b04d7d60717c16b778ebbb26ec63752ada25.tar.bz2
dsub-d8d8b04d7d60717c16b778ebbb26ec63752ada25.zip
Merge pull request #1112 from mvn23/fix-album-sort
Fix album sort with duplicate track numbers
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/domain/MusicDirectory.java9
1 files changed, 4 insertions, 5 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..a2b6d4ed 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,14 @@ 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());
+ } else if(lhsTrack != null && rhsTrack != null) {
return lhsTrack.compareTo(rhsTrack);
} else 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) {