getTrendingComments method
Future<List<MediaComment> >
getTrendingComments({
- CommentType? commentType,
- MediaType? mediaType,
- bool? includeReplies,
- bool extendedFull = false,
- RequestPagination? pagination,
Returns all comments with the most likes and replies over the last 7 days.
You can optionally filter by the commentType
and mediaType
to limit what gets returned.
If you want to includeReplies
that will return replies in place alongside top level comments.
commentType
- Possible values: all , reviews , shouts .
mediaType
- Possible values: all , movies , shows , seasons , episodes , lists .
includeReplies
- include comment replies
📄 Pagination ✨ Extended Info 😁 Emojis
Implementation
Future<List<MediaComment>> getTrendingComments(
{CommentType? commentType,
MediaType? mediaType,
bool? includeReplies,
bool extendedFull = false,
RequestPagination? pagination}) async {
Map<String, dynamic>? params;
if (includeReplies ?? false) {
params = {"include_replies": includeReplies};
}
var request = "";
if (commentType != null) {
request = "/${commentType.value}";
}
if (mediaType != null) {
request += "/${mediaType.value}";
}
return await _manager._getList<MediaComment>("comments/trending$request",
extendedFull: extendedFull,
pagination: pagination,
queryParamameters: params);
}