mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
Some updates
This commit is contained in:
@ -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*
|
||||
*
|
||||
|
Reference in New Issue
Block a user