Fixed guest sessions ratings

This commit is contained in:
Stuart Boston
2015-03-04 15:26:27 +00:00
parent 25e22919a5
commit 591ccdc0f1
5 changed files with 92 additions and 45 deletions
@@ -58,7 +58,8 @@ public class TmdbAccount extends AbstractMethod {
}
/**
* Get the basic information for an account. You will need to have a valid session id.
* Get the basic information for an account. You will need to have a valid
* session id.
*
* @param sessionId
* @return
@@ -302,7 +303,14 @@ public class TmdbAccount extends AbstractMethod {
parameters.add(Param.PAGE, page);
//TODO: Test this works
if (sortBy != null) {
parameters.add(Param.SORT_BY, sortBy.getPropertyString());
// Only created_at is supported
parameters.add(Param.SORT_BY, "created_at");
if (sortBy.getPropertyString().endsWith("asc")) {
parameters.add(Param.SORT_ORDER, "asc");
} else {
parameters.add(Param.SORT_ORDER, "desc");
}
}
URL url = new ApiUrl(apiKey, MethodBase.GUEST_SESSION).subMethod(MethodSub.RATED_MOVIES_GUEST).buildUrl(parameters);
@@ -66,6 +66,7 @@ public enum Param {
RELEASE_DATE_GTE("release_date.gte="),
RELEASE_DATE_LTE("release_date.lte="),
SORT_BY("sort_by="),
SORT_ORDER("sort_order="),
VOTE_AVERAGE_GTE("vote_average.gte="),
VOTE_AVERAGE_LTE("vote_average.lte="),
VOTE_COUNT_GTE("vote_count.gte="),