1
0
mirror of https://framagit.org/tom79/fedilab-tube synced 2025-06-05 21:09:11 +02:00

Some updates

This commit is contained in:
Thomas
2020-09-03 18:56:28 +02:00
parent 4c51a7c7e8
commit 6d66b2f08b
3 changed files with 30 additions and 3 deletions

View File

@ -1167,6 +1167,33 @@ public class PeertubeAPI {
}
}
/**
* Retrieves subscription videos *synchronously*
*
* @param max_id String id max
* @return APIResponse
*/
public APIResponse getSubscriptionUsers(String max_id) {
List<Account> accounts = new ArrayList<>();
try {
HttpsConnection httpsConnection = new HttpsConnection(context);
HashMap<String, String> params = new HashMap<>();
if (max_id != null)
params.put("start", max_id);
params.put("sort", "-createdAt");
String response = httpsConnection.get("/users/me/subscriptions", 60, params, null);
JSONArray jsonArray = new JSONObject(response).getJSONArray("data");
accounts = parseAccountResponsePeertube(jsonArray);
} catch (HttpsConnection.HttpsConnectionException e) {
setError(e.getStatusCode(), e);
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
e.printStackTrace();
}
apiResponse.setAccounts(accounts);
return apiResponse;
}
/**
* Retrieves overview videos *synchronously*
*