mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
Fix SubsonicPreferences creation
This commit is contained in:
parent
7bd2b10165
commit
ca1831d23c
3 changed files with 8 additions and 13 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue