aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github/daneren2005/dsub/service/parser
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-04-26 21:25:42 -0700
committerScott Jackson <daneren2005@gmail.com>2016-04-26 21:25:42 -0700
commitca5d525b3efb7fcdc8ee00b4324a534dc443a034 (patch)
tree4d43b065014f4ad6771f1b6d072a23975c39ad54 /app/src/main/java/github/daneren2005/dsub/service/parser
parentfa30b8dd4caff884cee6b8f787434efeabbdc1c2 (diff)
downloaddsub-ca5d525b3efb7fcdc8ee00b4324a534dc443a034.tar.gz
dsub-ca5d525b3efb7fcdc8ee00b4324a534dc443a034.tar.bz2
dsub-ca5d525b3efb7fcdc8ee00b4324a534dc443a034.zip
Add Ampache to list of server checks
Diffstat (limited to 'app/src/main/java/github/daneren2005/dsub/service/parser')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/parser/AbstractParser.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/parser/AbstractParser.java b/app/src/main/java/github/daneren2005/dsub/service/parser/AbstractParser.java
index 664adcfb..4ee37dad 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/parser/AbstractParser.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/parser/AbstractParser.java
@@ -36,6 +36,12 @@ import github.daneren2005.dsub.util.Util;
*/
public abstract class AbstractParser {
private static final String TAG = AbstractParser.class.getSimpleName();
+ private static final String SUBSONIC_RESPONSE = "subsonic-response";
+ private static final String MADSONIC_RESPONSE = "madsonic-response";
+ private static final String SUBSONIC = "subsonic";
+ private static final String MADSONIC = "madsonic";
+ private static final String AMPACHE = "ampache";
+
protected final Context context;
protected final int instance;
private XmlPullParser parser;
@@ -132,16 +138,18 @@ public abstract class AbstractParser {
protected String getElementName() {
String name = parser.getName();
- if ("subsonic-response".equals(name) || "madsonic-response".equals(name)) {
+ if (SUBSONIC_RESPONSE.equals(name) || MADSONIC_RESPONSE.equals(name)) {
rootElementFound = true;
String version = get("version");
if (version != null) {
ServerInfo server = new ServerInfo();
server.setRestVersion(new Version(version));
- if("madsonic".equals(get("type")) || "madsonic-response".equals(name)) {
+ if(MADSONIC.equals(get("type")) || MADSONIC_RESPONSE.equals(name)) {
server.setRestType(ServerInfo.TYPE_MADSONIC);
- } else if("subsonic".equals(get("type")) && server.checkServerVersion(context, "1.13")) {
+ } if(AMPACHE.equals(get("type"))) {
+ server.setRestType(ServerInfo.TYPE_AMPACHE);
+ } else if(SUBSONIC.equals(get("type")) && server.checkServerVersion(context, "1.13")) {
// Oh am I going to regret this
server.setRestType(ServerInfo.TYPE_MADSONIC);
server.setRestVersion(new Version("2.0.0"));