mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Merge pull request #633 from Bnyro/comment-count
Add support for extracting the comment count
This commit is contained in:
commit
d4d0a40928
2 changed files with 5 additions and 3 deletions
|
@ -357,7 +357,7 @@ public class StreamHandlers {
|
||||||
nextpage = mapper.writeValueAsString(page);
|
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);
|
return mapper.writeValueAsBytes(commentsItem);
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ public class StreamHandlers {
|
||||||
nextpage = mapper.writeValueAsString(page);
|
nextpage = mapper.writeValueAsString(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
CommentsPage commentsItem = new CommentsPage(comments, nextpage, false);
|
CommentsPage commentsItem = new CommentsPage(comments, nextpage, false, -1);
|
||||||
|
|
||||||
return mapper.writeValueAsBytes(commentsItem);
|
return mapper.writeValueAsBytes(commentsItem);
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,12 @@ public class CommentsPage {
|
||||||
public List<Comment> comments;
|
public List<Comment> comments;
|
||||||
public String nextpage;
|
public String nextpage;
|
||||||
public boolean disabled;
|
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.comments = comments;
|
||||||
this.nextpage = nextpage;
|
this.nextpage = nextpage;
|
||||||
this.disabled = disabled;
|
this.disabled = disabled;
|
||||||
|
this.commentCount = commentCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue