Add support for extracting the comment count

This commit is contained in:
Bnyro 2023-06-26 12:05:16 +02:00
parent f4200da70b
commit 1cace30971
2 changed files with 5 additions and 3 deletions

View file

@ -357,7 +357,7 @@ public class StreamHandlers {
nextpage = mapper.writeValueAsString(page);
}
CommentsPage commentsItem = new CommentsPage(comments, nextpage, info.isCommentsDisabled());
CommentsPage commentsItem = new CommentsPage(comments, nextpage, info.isCommentsDisabled(), info.getCommentsCount());
return mapper.writeValueAsBytes(commentsItem);
@ -395,7 +395,7 @@ public class StreamHandlers {
nextpage = mapper.writeValueAsString(page);
}
CommentsPage commentsItem = new CommentsPage(comments, nextpage, false);
CommentsPage commentsItem = new CommentsPage(comments, nextpage, false, -1);
return mapper.writeValueAsBytes(commentsItem);

View file

@ -7,10 +7,12 @@ public class CommentsPage {
public List<Comment> comments;
public String nextpage;
public boolean disabled;
public int commentCount;
public CommentsPage(List<Comment> comments, String nextpage, boolean disabled) {
public CommentsPage(List<Comment> comments, String nextpage, boolean disabled, int commentCount) {
this.comments = comments;
this.nextpage = nextpage;
this.disabled = disabled;
this.commentCount = commentCount;
}
}