From 4d745b8a84553a0a5ca19b10c08b87e9d364805f Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 17 Oct 2022 14:34:50 +0100 Subject: [PATCH] Add support for reply count and bump deps. --- build.gradle | 18 +++++++++--------- .../me/kavin/piped/utils/ResponseHelper.java | 4 ++-- .../java/me/kavin/piped/utils/obj/Comment.java | 5 +++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index d67c361..97f7e02 100644 --- a/build.gradle +++ b/build.gradle @@ -11,26 +11,26 @@ repositories { dependencies { implementation 'org.apache.commons:commons-lang3:3.12.0' - implementation 'org.apache.commons:commons-text:1.9' + implementation 'org.apache.commons:commons-text:1.10.0' implementation 'commons-io:commons-io:2.11.0' - implementation 'it.unimi.dsi:fastutil-core:8.5.8' + implementation 'it.unimi.dsi:fastutil-core:8.5.9' implementation 'commons-codec:commons-codec:1.15' implementation 'org.bouncycastle:bcprov-jdk15on:1.70' - implementation 'com.github.FireMasterK.NewPipeExtractor:NewPipeExtractor:d3706d852d6711e2dfccb87b5885638c6981dca8' + implementation 'com.github.FireMasterK.NewPipeExtractor:NewPipeExtractor:2e9763d4d2e1e11a885c99291cb3c6cf2a349617' implementation 'com.github.FireMasterK:nanojson:5df3e81e87b791d01f132f376e4b7d4a1780f346' implementation 'com.fasterxml.jackson.core:jackson-core:2.13.4' implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.4' implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4' - implementation 'org.json:json:20220320' + implementation 'org.json:json:20220924' implementation 'com.github.ben-manes.caffeine:caffeine:3.1.1' implementation 'com.rometools:rome:1.18.0' implementation 'com.github.ipfs:java-ipfs-http-client:v1.3.3' implementation 'org.jsoup:jsoup:1.15.3' - implementation 'io.activej:activej-common:5.4.2' - implementation 'io.activej:activej-http:5.4.2' - implementation 'io.activej:activej-boot:5.4.2' - implementation 'io.activej:activej-specializer:5.4.2' - implementation 'io.activej:activej-launchers-http:5.4.2' + implementation 'io.activej:activej-common:5.4.3' + implementation 'io.activej:activej-http:5.4.3' + implementation 'io.activej:activej-boot:5.4.3' + implementation 'io.activej:activej-specializer:5.4.3' + implementation 'io.activej:activej-launchers-http:5.4.3' implementation 'org.hsqldb:hsqldb:2.7.0' implementation 'org.postgresql:postgresql:42.5.0' implementation 'org.hibernate:hibernate-core:6.1.0.Final' diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index 45b7e59..af7a5bb 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -633,7 +633,7 @@ public class ResponseHelper { comments.add(new Comment(comment.getUploaderName(), rewriteURL(comment.getUploaderAvatarUrl()), comment.getCommentId(), comment.getCommentText(), comment.getTextualUploadDate(), - substringYouTube(comment.getUploaderUrl()), repliespage, comment.getLikeCount(), + substringYouTube(comment.getUploaderUrl()), repliespage, comment.getLikeCount(), comment.getReplyCount(), comment.isHeartedByUploader(), comment.isPinned(), comment.isUploaderVerified())); } catch (JsonProcessingException e) { ExceptionHandler.handle(e); @@ -671,7 +671,7 @@ public class ResponseHelper { comments.add(new Comment(comment.getUploaderName(), rewriteURL(comment.getUploaderAvatarUrl()), comment.getCommentId(), comment.getCommentText(), comment.getTextualUploadDate(), - substringYouTube(comment.getUploaderUrl()), repliespage, comment.getLikeCount(), + substringYouTube(comment.getUploaderUrl()), repliespage, comment.getLikeCount(), comment.getReplyCount(), comment.isHeartedByUploader(), comment.isPinned(), comment.isUploaderVerified())); } catch (JsonProcessingException e) { ExceptionHandler.handle(e); diff --git a/src/main/java/me/kavin/piped/utils/obj/Comment.java b/src/main/java/me/kavin/piped/utils/obj/Comment.java index c62c238..ab68b6c 100644 --- a/src/main/java/me/kavin/piped/utils/obj/Comment.java +++ b/src/main/java/me/kavin/piped/utils/obj/Comment.java @@ -3,11 +3,11 @@ package me.kavin.piped.utils.obj; public class Comment { public String author, thumbnail, commentId, commentText, commentedTime, commentorUrl, repliesPage; - public int likeCount; + public int likeCount, replyCount; public boolean hearted, pinned, verified; public Comment(String author, String thumbnail, String commentId, String commentText, String commentedTime, - String commentorUrl, String repliesPage, int likeCount, boolean hearted, boolean pinned, boolean verified) { + String commentorUrl, String repliesPage, int likeCount, int replyCount, boolean hearted, boolean pinned, boolean verified) { this.author = author; this.thumbnail = thumbnail; this.commentId = commentId; @@ -16,6 +16,7 @@ public class Comment { this.commentorUrl = commentorUrl; this.repliesPage = repliesPage; this.likeCount = likeCount; + this.replyCount = replyCount; this.hearted = hearted; this.pinned = pinned; this.verified = verified;