mirror of
https://github.com/CappielloAntonio/tempo.git
synced 2026-02-01 15:03:37 +00:00
Fix SubsonicPreferences creation
This commit is contained in:
@@ -15,8 +15,7 @@ public class SubsonicPreferences {
|
||||
this.serverUrl = serverUrl;
|
||||
this.username = username;
|
||||
if(password != null) this.authentication = new SubsonicAuthentication(password);
|
||||
if(token != null) this.authentication.setToken(token);
|
||||
if(salt != null) this.authentication.setSalt(salt);
|
||||
if(token != null && salt != null) this.authentication = new SubsonicAuthentication(token, salt);
|
||||
}
|
||||
|
||||
public String getServerUrl() {
|
||||
@@ -47,6 +46,11 @@ public class SubsonicPreferences {
|
||||
update(password);
|
||||
}
|
||||
|
||||
public SubsonicAuthentication(String token, String salt) {
|
||||
this.token = token;
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
public String getSalt() {
|
||||
return salt;
|
||||
}
|
||||
@@ -55,14 +59,6 @@ public class SubsonicPreferences {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setSalt(String salt) {
|
||||
this.salt = salt;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
void update(String password) {
|
||||
this.salt = UUID.randomUUID().toString();
|
||||
this.token = StringUtil.tokenize(password + salt);
|
||||
|
||||
Reference in New Issue
Block a user