Added support for get_ratings API call to retrieve list of liked/disliked files
This commit is contained in:
@@ -139,6 +139,13 @@ public class ApiClient {
|
||||
invokeAndReturn(builder, Success.class);
|
||||
}
|
||||
|
||||
public FileRating[] getRatedFiles(String auth) throws IOException, ApiException {
|
||||
QueryBuilder builder = new QueryBuilder(ReplayModApiMethods.get_ratings);
|
||||
builder.put("auth", auth);
|
||||
|
||||
return invokeAndReturn(builder, RatedFiles.class).getRated();
|
||||
}
|
||||
|
||||
public void favFile(String auth, int file, boolean fav) throws IOException, ApiException {
|
||||
QueryBuilder builder = new QueryBuilder(ReplayModApiMethods.fav_file);
|
||||
builder.put("auth", auth);
|
||||
|
||||
@@ -14,6 +14,7 @@ public class ReplayModApiMethods {
|
||||
public static final String get_thumbnail = REPLAYMOD_BASE_URL+"get_thumbnail";
|
||||
public static final String remove_file = REPLAYMOD_BASE_URL+"remove_file";
|
||||
public static final String rate_file = REPLAYMOD_BASE_URL+"rate_file";
|
||||
public static final String get_ratings = REPLAYMOD_BASE_URL+"get_ratings";
|
||||
public static final String fav_file = REPLAYMOD_BASE_URL+"fav_file";
|
||||
public static final String get_favorites = REPLAYMOD_BASE_URL+"get_favorites";
|
||||
public static final String check_auth = REPLAYMOD_BASE_URL+"check_auth";
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package eu.crushedpixel.replaymod.api.replay.holders;
|
||||
|
||||
public class FileRating {
|
||||
|
||||
private int file;
|
||||
private boolean rating;
|
||||
|
||||
public int getFileID() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public boolean getRating() {
|
||||
return rating;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package eu.crushedpixel.replaymod.api.replay.holders;
|
||||
|
||||
public class RatedFiles {
|
||||
|
||||
private FileRating[] rated;
|
||||
|
||||
public FileRating[] getRated() {
|
||||
return rated;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user