Use p= authentication parameter when authMethod is false.

This commit is contained in:
dddddd-mmmmmm 2020-01-13 22:08:01 +11:00
parent 4254c8ad9f
commit 5141eb6e81
1 changed files with 16 additions and 10 deletions

View File

@ -323,6 +323,9 @@ public final class Util {
builder.addPathSegment("rest");
builder.addPathSegment(method + ".view");
builder.addQueryParameter("u", username);
if (prefs.getBoolean(Constants.PREFERENCES_KEY_AUTH_METHOD, true)) {
int hash = (username + password).hashCode();
Pair<String, String> values = tokens.get(hash);
if (values == null) {
@ -332,9 +335,12 @@ public final class Util {
tokens.put(hash, values);
}
builder.addQueryParameter("u", username);
builder.addQueryParameter("s", values.getFirst());
builder.addQueryParameter("t", values.getSecond());
} else {
builder.addQueryParameter("p", password);
}
builder.addQueryParameter("v", Constants.REST_PROTOCOL_VERSION_SUBSONIC);
builder.addQueryParameter("c", Constants.REST_CLIENT_ID);