getRecentComments method
Future<List<MediaComment> >
getRecentComments({
- CommentType? commentType,
- MediaType? mediaType,
- bool? includeReplies,
- bool extendedFull = false,
- RequestPagination? pagination,
Returns the most recently written comments across all of Trakt.
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>> getRecentComments(
{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/recent$request",
extendedFull: extendedFull,
pagination: pagination,
queryParamameters: params);
}