aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-06-02 22:10:38 -0700
committerScott Jackson <daneren2005@gmail.com>2013-06-02 22:10:38 -0700
commit4ded97251b07b1be8be0aaeeba1084a5bfba08e0 (patch)
treea64991986691d1effc90ea640e7f980d9a10ca3c /subsonic-android
parentea951b9e011210735b96e64f6b70e6dbe8757007 (diff)
downloaddsub-4ded97251b07b1be8be0aaeeba1084a5bfba08e0.tar.gz
dsub-4ded97251b07b1be8be0aaeeba1084a5bfba08e0.tar.bz2
dsub-4ded97251b07b1be8be0aaeeba1084a5bfba08e0.zip
Only apply sorting on version > 4.7
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java b/subsonic-android/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
index ce1a70fc..038518c6 100644
--- a/subsonic-android/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
+++ b/subsonic-android/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java
@@ -22,7 +22,9 @@ import android.content.Context;
import android.util.Log;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.MusicDirectory;
+import github.daneren2005.dsub.domain.Version;
import github.daneren2005.dsub.util.ProgressListener;
+import github.daneren2005.dsub.util.Util;
import org.xmlpull.v1.XmlPullParser;
import java.io.Reader;
@@ -33,13 +35,14 @@ import java.io.Reader;
public class MusicDirectoryParser extends MusicDirectoryEntryParser {
private static final String TAG = MusicDirectoryParser.class.getSimpleName();
+ private Context context;
public MusicDirectoryParser(Context context) {
super(context);
+ this.context = context;
}
public MusicDirectory parse(String artist, Reader reader, ProgressListener progressListener) throws Exception {
-
long t0 = System.currentTimeMillis();
updateProgress(progressListener, R.string.parser_reading);
init(reader);
@@ -66,7 +69,13 @@ public class MusicDirectoryParser extends MusicDirectoryEntryParser {
validate();
updateProgress(progressListener, R.string.parser_reading_done);
- dir.sortChildren();
+
+ // Only apply sorting on server version 4.7 and greater, where disc is supported
+ Version version = Util.getServerRestVersion(context);
+ Version discVersion = new Version("1.8.0");
+ if(version.compareTo(discVersion) >= 0) {
+ dir.sortChildren();
+ }
long t1 = System.currentTimeMillis();
Log.d(TAG, "Got music directory in " + (t1 - t0) + "ms.");