From 6d66b2f08b22ffbea73bb0223c23df6947186014 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 3 Sep 2020 18:56:28 +0200 Subject: [PATCH] Some updates --- app/build.gradle | 4 +-- .../fedilabtube/client/PeertubeAPI.java | 27 +++++++++++++++++++ build.gradle | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index ab7b912..fd59e47 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,8 +40,8 @@ allprojects { dependencies { implementation "androidx.multidex:multidex:2.0.1" implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'com.google.android.material:material:1.1.0' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.vectordrawable:vectordrawable:1.1.0' implementation 'androidx.navigation:navigation-fragment:2.3.0' diff --git a/app/src/main/java/app/fedilab/fedilabtube/client/PeertubeAPI.java b/app/src/main/java/app/fedilab/fedilabtube/client/PeertubeAPI.java index f3026a4..6e2ac97 100644 --- a/app/src/main/java/app/fedilab/fedilabtube/client/PeertubeAPI.java +++ b/app/src/main/java/app/fedilab/fedilabtube/client/PeertubeAPI.java @@ -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 accounts = new ArrayList<>(); + try { + HttpsConnection httpsConnection = new HttpsConnection(context); + HashMap 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* * diff --git a/build.gradle b/build.gradle index 9a8c55f..6354122 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath "com.android.tools.build:gradle:4.0.0" + classpath 'com.android.tools.build:gradle:4.0.1' def nav_version = "2.3.0" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" // NOTE: Do not place your application dependencies here; they belong