File tree Expand file tree Collapse file tree
extractor/src/main/java/org/schabi/newpipe/extractor/comments Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ public class CommentsInfoItem extends InfoItem {
2222 private boolean pinned ;
2323 private int streamPosition ;
2424
25+ public static final int NO_LIKE_COUNT = -1 ;
2526 public static final int NO_STREAM_POSITION = -1 ;
2627
2728 public CommentsInfoItem (int serviceId , String url , String name ) {
@@ -85,6 +86,10 @@ public void setUploadDate(@Nullable DateWrapper uploadDate) {
8586 this .uploadDate = uploadDate ;
8687 }
8788
89+ /**
90+ * @return the comment's like count
91+ * or {@link CommentsInfoItem#NO_LIKE_COUNT} if it is unavailable
92+ */
8893 public int getLikeCount () {
8994 return likeCount ;
9095 }
Original file line number Diff line number Diff line change 1212public interface CommentsInfoItemExtractor extends InfoItemExtractor {
1313
1414 /**
15- * Return the like count of the comment, or -1 if it's unavailable
15+ * Return the like count of the comment,
16+ * or {@link CommentsInfoItem#NO_LIKE_COUNT} if it is unavailable.
17+ *
1618 * <br>
19+ *
1720 * NOTE: Currently only implemented for YT {@link YoutubeCommentsInfoItemExtractor#getLikeCount()}
1821 * with limitations (only approximate like count is returned)
1922 *
2023 * @see StreamExtractor#getLikeCount()
24+ * @return the comment's like count
25+ * or {@link CommentsInfoItem#NO_LIKE_COUNT} if it is unavailable
2126 */
2227 default int getLikeCount () throws ParsingException {
23- return - 1 ;
28+ return CommentsInfoItem . NO_LIKE_COUNT ;
2429 }
2530
2631 /**
You can’t perform that action at this time.
0 commit comments