mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
Add a basic form of unsecure authentication (in plain password)
This commit is contained in:
parent
e5aec08c8e
commit
d93c3bb45c
8 changed files with 44 additions and 9 deletions
|
|
@ -100,7 +100,7 @@ public class Subsonic {
|
|||
public String getUrl() {
|
||||
String url = preferences.getServerUrl() + "/rest/";
|
||||
|
||||
return url.replace("//rest","/rest");
|
||||
return url.replace("//rest", "/rest");
|
||||
}
|
||||
|
||||
public Map<String, String> getParams() {
|
||||
|
|
@ -112,6 +112,8 @@ public class Subsonic {
|
|||
params.put("c", preferences.getClientName());
|
||||
params.put("f", "xml");
|
||||
|
||||
if (preferences.getPassword() != null && !preferences.getPassword().trim().equals("")) params.put("p", preferences.getPassword());
|
||||
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.util.UUID;
|
|||
public class SubsonicPreferences {
|
||||
private String serverUrl;
|
||||
private String username;
|
||||
private String password;
|
||||
private String clientName = "Play";
|
||||
private SubsonicAuthentication authentication;
|
||||
|
||||
|
|
@ -18,6 +19,10 @@ public class SubsonicPreferences {
|
|||
return username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public String getClientName() {
|
||||
return clientName;
|
||||
}
|
||||
|
|
@ -34,6 +39,10 @@ public class SubsonicPreferences {
|
|||
this.username = username;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void setClientName(String clientName) {
|
||||
this.clientName = clientName;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue