forked from j62/ctbrec
1
0
Fork 0

Fix CamSoda token label

This commit is contained in:
0xb00bface 2021-07-18 20:07:51 +02:00
parent 0d7393ee5b
commit 7e3073544e
2 changed files with 9 additions and 6 deletions

View File

@ -1,3 +1,7 @@
4.4.4
========================
* Fixed Camsoda token label
4.4.3
========================
* Changed Camsoda audio codec back to AAC. Sound should be back for recordings

View File

@ -64,15 +64,14 @@ public class Camsoda extends AbstractSite {
throw new IOException("Account settings not available");
}
String username = Config.getInstance().getSettings().camsodaUsername;
String url = BASE_URI + "/api/v1/user/" + username;
String url = BASE_URI + "/api/v1/user/current";
Request request = new Request.Builder().url(url).build();
try(Response response = getHttpClient().execute(request)) {
if(response.isSuccessful()) {
try (Response response = getHttpClient().execute(request)) {
if (response.isSuccessful()) {
JSONObject json = new JSONObject(response.body().string());
if(json.has("user")) {
if (json.has("user")) {
JSONObject user = json.getJSONObject("user");
if(user.has("tokens")) {
if (user.has("tokens")) {
return (double) user.getInt("tokens");
}
}