From f9f4dd8e748d29b917479b2c2b6a4077f0382a3e Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 18 Aug 2021 01:37:49 +0530 Subject: [PATCH] Add verified info in more places. --- .../me/kavin/piped/utils/ResponseHelper.java | 16 ++++++++-------- .../java/me/kavin/piped/utils/obj/Channel.java | 8 +++++--- .../me/kavin/piped/utils/obj/StreamItem.java | 4 +++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index a391050..cc32abc 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -175,7 +175,7 @@ public class ResponseHelper { StreamInfoItem item = (StreamInfoItem) o; relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), - item.getTextualUploadDate(), item.getDuration(), item.getViewCount())); + item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); }); List segments = new ObjectArrayList<>(); @@ -209,7 +209,7 @@ public class ResponseHelper { StreamInfoItem item = o; relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), - item.getTextualUploadDate(), item.getDuration(), item.getViewCount())); + item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); }); Multithreading.runAsync(() -> { @@ -245,8 +245,8 @@ public class ResponseHelper { } final Channel channel = new Channel(info.getId(), info.getName(), rewriteURL(info.getAvatarUrl()), - rewriteURL(info.getBannerUrl()), info.getDescription(), nextpage, info.getSubscriberCount(), - relatedStreams); + rewriteURL(info.getBannerUrl()), info.getDescription(), info.getSubscriberCount(), info.isVerified(), + nextpage, relatedStreams); IPFS.publishData(channel); @@ -268,7 +268,7 @@ public class ResponseHelper { StreamInfoItem item = o; relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), - item.getTextualUploadDate(), item.getDuration(), item.getViewCount())); + item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); }); String nextpage = null; @@ -301,7 +301,7 @@ public class ResponseHelper { StreamInfoItem item = o; relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), - item.getTextualUploadDate(), item.getDuration(), item.getViewCount())); + item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); }); return Constants.mapper.writeValueAsBytes(relatedStreams); @@ -318,7 +318,7 @@ public class ResponseHelper { StreamInfoItem item = o; relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), - item.getTextualUploadDate(), item.getDuration(), item.getViewCount())); + item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); }); String nextpage = null; @@ -351,7 +351,7 @@ public class ResponseHelper { StreamInfoItem item = o; relatedStreams.add(new StreamItem(item.getUrl().substring(23), item.getName(), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), item.getUploaderUrl().substring(23), - item.getTextualUploadDate(), item.getDuration(), item.getViewCount())); + item.getTextualUploadDate(), item.getDuration(), item.getViewCount(), item.isUploaderVerified())); }); String nextpage = null; diff --git a/src/main/java/me/kavin/piped/utils/obj/Channel.java b/src/main/java/me/kavin/piped/utils/obj/Channel.java index 2e55828..598edc4 100644 --- a/src/main/java/me/kavin/piped/utils/obj/Channel.java +++ b/src/main/java/me/kavin/piped/utils/obj/Channel.java @@ -6,17 +6,19 @@ public class Channel { public String id, name, avatarUrl, bannerUrl, description, nextpage; public long subscriberCount; + public boolean verified; public List relatedStreams; - public Channel(String id, String name, String avatarUrl, String bannerUrl, String description, String nextpage, - long subscriberCount, List relatedStreams) { + public Channel(String id, String name, String avatarUrl, String bannerUrl, String description, long subscriberCount, + boolean verified, String nextpage, List relatedStreams) { this.id = id; this.name = name; this.avatarUrl = avatarUrl; this.bannerUrl = bannerUrl; this.description = description; - this.nextpage = nextpage; this.subscriberCount = subscriberCount; + this.verified = verified; + this.nextpage = nextpage; this.relatedStreams = relatedStreams; } } diff --git a/src/main/java/me/kavin/piped/utils/obj/StreamItem.java b/src/main/java/me/kavin/piped/utils/obj/StreamItem.java index e6415c3..2ac2795 100644 --- a/src/main/java/me/kavin/piped/utils/obj/StreamItem.java +++ b/src/main/java/me/kavin/piped/utils/obj/StreamItem.java @@ -4,9 +4,10 @@ public class StreamItem { public String url, title, thumbnail, uploaderName, uploaderUrl, uploadedDate; public long duration, views; + public boolean uploaderVerified; public StreamItem(String url, String title, String thumbnail, String uploaderName, String uploaderUrl, - String uploadedDate, long duration, long views) { + String uploadedDate, long duration, long views, boolean uploaderVerified) { this.url = url; this.title = title; this.thumbnail = thumbnail; @@ -15,5 +16,6 @@ public class StreamItem { this.uploadedDate = uploadedDate; this.duration = duration; this.views = views; + this.uploaderVerified = uploaderVerified; } }