aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-08-06 13:58:00 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-08-06 13:58:00 -0700
commit5e9b3ff4ba336ea838e22ac82be113033f906003 (patch)
tree107e622099869443d4287fc4c5caa2c0ad53482b /src/github
parent3e4ea1386665c79055d5b39cc9dcf5332dcd5a06 (diff)
downloaddsub-5e9b3ff4ba336ea838e22ac82be113033f906003.tar.gz
dsub-5e9b3ff4ba336ea838e22ac82be113033f906003.tar.bz2
dsub-5e9b3ff4ba336ea838e22ac82be113033f906003.zip
Make sorting functionally identical to server sort
MediaFileSorter inside of subsonic-main/src/main/java/net/sourceforge/subsonic/service/MediaFileService.java
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/domain/MusicDirectory.java14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/github/daneren2005/dsub/domain/MusicDirectory.java b/src/github/daneren2005/dsub/domain/MusicDirectory.java
index bb49378a..6e51eff8 100644
--- a/src/github/daneren2005/dsub/domain/MusicDirectory.java
+++ b/src/github/daneren2005/dsub/domain/MusicDirectory.java
@@ -329,6 +329,8 @@ public class MusicDirectory {
return -1;
} else if(!lhs.isDirectory() && rhs.isDirectory()) {
return 1;
+ } else if(lhs.isDirectory() && rhs.isDirectory()) {
+ return lhs.getTitle().compareToIgnoreCase(rhs.getTitle());
}
Integer lhsDisc = lhs.getDiscNumber();
@@ -340,20 +342,12 @@ public class MusicDirectory {
} else if(lhsDisc > rhsDisc) {
return 1;
}
- } else if(lhsDisc != null) {
- return -1;
- } else if(rhsDisc != null) {
- return 1;
}
Integer lhsTrack = lhs.getTrack();
Integer rhsTrack = rhs.getTrack();
if(lhsTrack != null && rhsTrack != null) {
- if(lhsTrack < rhsTrack) {
- return -1;
- } else if(lhsTrack > rhsTrack) {
- return 1;
- }
+ return lhsTrack.compareTo(rhsTrack);
} else if(lhsTrack != null) {
return -1;
} else if(rhsTrack != null) {
@@ -371,4 +365,4 @@ public class MusicDirectory {
}
}
}
-} \ No newline at end of file
+}