Added get_favorites API call to ApiClient
This commit is contained in:
@@ -145,6 +145,13 @@ public class ApiClient {
|
||||
invokeAndReturn(builder, Success.class);
|
||||
}
|
||||
|
||||
public int[] getFavorites(String auth) throws IOException, ApiException {
|
||||
QueryBuilder builder = new QueryBuilder(ApiMethods.get_favorites);
|
||||
builder.put("auth", auth);
|
||||
|
||||
return invokeAndReturn(builder, Favorites.class).getFavorited();
|
||||
}
|
||||
|
||||
public void removeFile(String auth, int file) throws IOException, ApiException {
|
||||
QueryBuilder builder = new QueryBuilder(ApiMethods.remove_file);
|
||||
builder.put("auth", auth);
|
||||
|
||||
@@ -14,6 +14,7 @@ public class ApiMethods {
|
||||
public static final String remove_file = "remove_file";
|
||||
public static final String rate_file = "rate_file";
|
||||
public static final String fav_file = "fav_file";
|
||||
public static final String get_favorites = "get_favorites";
|
||||
public static final String check_auth = "check_auth";
|
||||
public static final String get_language = "get_language";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package eu.crushedpixel.replaymod.api.client.holders;
|
||||
|
||||
public class Favorites {
|
||||
private int[] favorited;
|
||||
|
||||
public int[] getFavorited() { return favorited; }
|
||||
}
|
||||
Reference in New Issue
Block a user