mirror of
https://github.com/TeamPiped/Piped-Backend
synced 2025-09-06 21:41:54 +02:00
Add support for extracting the comment count
This commit is contained in:
parent
f4200da70b
commit
1cace30971
@ -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…
x
Reference in New Issue
Block a user