getRatings method

Future<List<RatedItem>> getRatings(
  1. String id, {
  2. MediaType? type,
  3. List<int>? ratings,
  4. bool useOAuth = false,
  5. bool extendedFull = false,
  6. RequestPagination? pagination,
})

Get a user's ratings filtered by type.

You can optionally filter for a specific rating between 1 and 10. Send a comma separated string for rating if you need multiple ratings.

id - User slug type - Possible values: movies , shows , seasons , episodes , all . ratings - Filter for a specific rating. Possible values: 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 . useOAuth - whether to make the request using OAuth header

🔓 OAuth Optional 📄 Pagination Optional ✨ Extended Info

Implementation

Future<List<RatedItem>> getRatings(String id,
    {MediaType? type,
    List<int>? ratings,
    bool useOAuth = false,
    bool extendedFull = false,
    RequestPagination? pagination}) async {
  var request = "users/$id/ratings";
  if (type != null) {
    request += "/${type.value}";
    if (ratings?.isNotEmpty ?? false) {
      request += "/${ratings!.join(",")}";
    }
  }

  if (useOAuth) {
    return await _manager._authenticatedGetList<RatedItem>(request,
        extendedFull: extendedFull, pagination: pagination);
  }
  return await _manager._getList<RatedItem>(request, extendedFull: extendedFull, pagination: pagination);
}