From 0e07295265783c8355b3aed486601ee336d09c94 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 6 May 2021 21:56:03 +0530 Subject: [PATCH] Add uploader info search. --- .../java/me/kavin/piped/utils/ResponseHelper.java | 8 ++++---- .../piped/utils/obj/search/SearchStream.java | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index f8eede8..74f099f 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -315,8 +315,8 @@ public class ResponseHelper { case STREAM: StreamInfoItem stream = (StreamInfoItem) item; items.add(new SearchStream(item.getName(), rewriteURL(item.getThumbnailUrl()), - item.getUrl().substring(23), stream.getTextualUploadDate(), stream.getViewCount(), - stream.getDuration())); + item.getUrl().substring(23), stream.getTextualUploadDate(), stream.getUploaderName(), + stream.getUploaderUrl().substring(23), stream.getViewCount(), stream.getDuration())); break; case CHANNEL: items.add(new SearchItem(item.getName(), rewriteURL(item.getThumbnailUrl()), @@ -348,8 +348,8 @@ public class ResponseHelper { case STREAM: StreamInfoItem stream = (StreamInfoItem) item; items.add(new SearchStream(item.getName(), rewriteURL(item.getThumbnailUrl()), - item.getUrl().substring(23), stream.getTextualUploadDate(), stream.getViewCount(), - stream.getDuration())); + item.getUrl().substring(23), stream.getTextualUploadDate(), stream.getUploaderName(), + stream.getUploaderUrl().substring(23), stream.getViewCount(), stream.getDuration())); break; case CHANNEL: items.add(new SearchItem(item.getName(), rewriteURL(item.getThumbnailUrl()), diff --git a/src/main/java/me/kavin/piped/utils/obj/search/SearchStream.java b/src/main/java/me/kavin/piped/utils/obj/search/SearchStream.java index e1cb4ff..c2e59c8 100644 --- a/src/main/java/me/kavin/piped/utils/obj/search/SearchStream.java +++ b/src/main/java/me/kavin/piped/utils/obj/search/SearchStream.java @@ -2,12 +2,15 @@ package me.kavin.piped.utils.obj.search; public class SearchStream extends SearchItem { - private String uploadDate; + private String uploadDate, uploader, uploaderUrl; private long views, duration; - public SearchStream(String name, String thumbnail, String url, String uploadDate, long views, long duration) { + public SearchStream(String name, String thumbnail, String url, String uploadDate, String uploader, + String uploaderUrl, long views, long duration) { super(name, thumbnail, url); this.uploadDate = uploadDate; + this.uploader = uploader; + this.uploaderUrl = uploaderUrl; this.views = views; this.duration = duration; } @@ -16,6 +19,14 @@ public class SearchStream extends SearchItem { return uploadDate; } + public String getUploader() { + return uploader; + } + + public String getUploaderUrl() { + return uploaderUrl; + } + public long getViews() { return views; }