aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-02-19 14:56:22 -0800
committerScott Jackson <daneren2005@gmail.com>2014-02-19 14:56:22 -0800
commit9ef5496a920059090f756f1c94bda61494abb91a (patch)
treea228ec9d9c9ff57337e2bc1b4048ec5d49e4ef13 /src/github
parent525cbf900b5f404c96e59de5fa512dc542bda12c (diff)
downloaddsub-9ef5496a920059090f756f1c94bda61494abb91a.tar.gz
dsub-9ef5496a920059090f756f1c94bda61494abb91a.tar.bz2
dsub-9ef5496a920059090f756f1c94bda61494abb91a.zip
Never try to sync against default servers
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
index a78b696e..1ef01328 100644
--- a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
+++ b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java
@@ -107,8 +107,10 @@ public class SubsonicSyncAdapter extends AbstractThreadedSyncAdapter {
int servers = Util.getServerCount(context);
for(int i = 1; i <= servers; i++) {
try {
- musicService.setInstance(i);
- onExecuteSync(context, i);
+ if(isValidServer(context, i)) {
+ musicService.setInstance(i);
+ onExecuteSync(context, i);
+ }
} catch(Exception e) {
Log.e(TAG, "Failed sync for " + className + "(" + i + ")", e);
}
@@ -144,4 +146,13 @@ public class SubsonicSyncAdapter extends AbstractThreadedSyncAdapter {
return downloaded;
}
+
+ private boolean isValidServer(Context context, int instance) {
+ String url = Util.getRESTUrl(context, "null", instance, false);
+ if(url.contains("demo.subsonic.org") || url.contains("yourhost")) {
+ return false;
+ } else {
+ return true;
+ }
+ }
}