mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Add support for extracting the comment count
This commit is contained in:
parent
f4200da70b
commit
1cace30971
2 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue