aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java3
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java2
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/parser/ShareParser.java1
3 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
index 52748e7b..925d69d7 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java
@@ -480,7 +480,8 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared
serverUsernamePreference.setText(null);
serverPasswordPreference.setText(null);
- int activeServer = Util.getActiveServer(context);
+ // Don't use Util.getActiveServer since it is 0 if offline
+ int activeServer = Util.getPreferences(context).getInt(Constants.PREFERENCES_KEY_SERVER_INSTANCE, 1);
for (int i = instance; i <= serverCount; i++) {
Util.removeInstanceName(context, i, activeServer);
}
diff --git a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
index b405211d..24a75c73 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
@@ -1954,7 +1954,7 @@ public class RESTMusicService implements MusicService {
request.addHeader("User-Agent", Constants.REST_CLIENT_ID);
// Set credentials to get through apache proxies that require authentication.
- int instance = prefs.getInt(Constants.PREFERENCES_KEY_SERVER_INSTANCE, 1);
+ int instance = getInstance(context);
String username = prefs.getString(Constants.PREFERENCES_KEY_USERNAME + instance, null);
String password = prefs.getString(Constants.PREFERENCES_KEY_PASSWORD + instance, null);
httpClient.getCredentialsProvider().setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT),
diff --git a/app/src/main/java/github/daneren2005/dsub/service/parser/ShareParser.java b/app/src/main/java/github/daneren2005/dsub/service/parser/ShareParser.java
index 418393d1..ea7934f4 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/parser/ShareParser.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/parser/ShareParser.java
@@ -57,7 +57,6 @@ public class ShareParser extends MusicDirectoryEntryParser {
int eventType;
SharedPreferences prefs = Util.getPreferences(context);
- int instance = prefs.getInt(Constants.PREFERENCES_KEY_SERVER_INSTANCE, 1);
String serverUrl = prefs.getString(Constants.PREFERENCES_KEY_SERVER_URL + instance, null);
if(serverUrl.charAt(serverUrl.length() - 1) != '/') {
serverUrl += '/';