Fix CamSoda token label
This commit is contained in:
parent
0d7393ee5b
commit
7e3073544e
|
@ -1,3 +1,7 @@
|
||||||
|
4.4.4
|
||||||
|
========================
|
||||||
|
* Fixed Camsoda token label
|
||||||
|
|
||||||
4.4.3
|
4.4.3
|
||||||
========================
|
========================
|
||||||
* Changed Camsoda audio codec back to AAC. Sound should be back for recordings
|
* Changed Camsoda audio codec back to AAC. Sound should be back for recordings
|
||||||
|
|
|
@ -64,15 +64,14 @@ public class Camsoda extends AbstractSite {
|
||||||
throw new IOException("Account settings not available");
|
throw new IOException("Account settings not available");
|
||||||
}
|
}
|
||||||
|
|
||||||
String username = Config.getInstance().getSettings().camsodaUsername;
|
String url = BASE_URI + "/api/v1/user/current";
|
||||||
String url = BASE_URI + "/api/v1/user/" + username;
|
|
||||||
Request request = new Request.Builder().url(url).build();
|
Request request = new Request.Builder().url(url).build();
|
||||||
try(Response response = getHttpClient().execute(request)) {
|
try (Response response = getHttpClient().execute(request)) {
|
||||||
if(response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
JSONObject json = new JSONObject(response.body().string());
|
JSONObject json = new JSONObject(response.body().string());
|
||||||
if(json.has("user")) {
|
if (json.has("user")) {
|
||||||
JSONObject user = json.getJSONObject("user");
|
JSONObject user = json.getJSONObject("user");
|
||||||
if(user.has("tokens")) {
|
if (user.has("tokens")) {
|
||||||
return (double) user.getInt("tokens");
|
return (double) user.getInt("tokens");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue