diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index 863ee3f..ccaaa95 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -83,9 +83,7 @@ import me.kavin.piped.utils.obj.db.PubSub; import me.kavin.piped.utils.obj.db.User; import me.kavin.piped.utils.obj.db.Video; import me.kavin.piped.utils.obj.search.SearchChannel; -import me.kavin.piped.utils.obj.search.SearchItem; import me.kavin.piped.utils.obj.search.SearchPlaylist; -import me.kavin.piped.utils.obj.search.SearchStream; import me.kavin.piped.utils.resp.AcceptedResponse; import me.kavin.piped.utils.resp.AlreadyRegisteredResponse; import me.kavin.piped.utils.resp.AuthenticationFailureResponse; @@ -417,15 +415,16 @@ public class ResponseHelper { final SearchInfo info = SearchInfo.getInfo(Constants.YOUTUBE_SERVICE, Constants.YOUTUBE_SERVICE.getSearchQHFactory().fromQuery(q, Collections.singletonList(filter), null)); - ObjectArrayList items = new ObjectArrayList<>(); + ObjectArrayList items = new ObjectArrayList<>(); info.getRelatedItems().forEach(item -> { switch (item.getInfoType()) { case STREAM: StreamInfoItem stream = (StreamInfoItem) item; - items.add(new SearchStream(item.getName(), rewriteURL(item.getThumbnailUrl()), - item.getUrl().substring(23), stream.getTextualUploadDate(), stream.getUploaderName(), - optionalSubstring(stream.getUploaderUrl(), 23), stream.getViewCount(), stream.getDuration(), + items.add(new StreamItem(stream.getUrl().substring(23), stream.getName(), + rewriteURL(stream.getThumbnailUrl()), stream.getUploaderName(), + stream.getUploaderUrl().substring(23), rewriteURL(stream.getUploaderAvatarUrl()), + stream.getTextualUploadDate(), stream.getDuration(), stream.getViewCount(), stream.isUploaderVerified())); break; case CHANNEL: @@ -460,15 +459,16 @@ public class ResponseHelper { Constants.YOUTUBE_SERVICE.getSearchQHFactory().fromQuery(q, Collections.singletonList(filter), null), prevpage); - ObjectArrayList items = new ObjectArrayList<>(); + ObjectArrayList items = new ObjectArrayList<>(); pages.getItems().forEach(item -> { switch (item.getInfoType()) { case STREAM: StreamInfoItem stream = (StreamInfoItem) item; - items.add(new SearchStream(item.getName(), rewriteURL(item.getThumbnailUrl()), - item.getUrl().substring(23), stream.getTextualUploadDate(), stream.getUploaderName(), - optionalSubstring(stream.getUploaderUrl(), 23), stream.getViewCount(), stream.getDuration(), + items.add(new StreamItem(stream.getUrl().substring(23), stream.getName(), + rewriteURL(stream.getThumbnailUrl()), stream.getUploaderName(), + stream.getUploaderUrl().substring(23), rewriteURL(stream.getUploaderAvatarUrl()), + stream.getTextualUploadDate(), stream.getDuration(), stream.getViewCount(), stream.isUploaderVerified())); break; case CHANNEL: diff --git a/src/main/java/me/kavin/piped/utils/obj/SearchResults.java b/src/main/java/me/kavin/piped/utils/obj/SearchResults.java index f346f5d..718e639 100644 --- a/src/main/java/me/kavin/piped/utils/obj/SearchResults.java +++ b/src/main/java/me/kavin/piped/utils/obj/SearchResults.java @@ -1,14 +1,13 @@ package me.kavin.piped.utils.obj; import it.unimi.dsi.fastutil.objects.ObjectArrayList; -import me.kavin.piped.utils.obj.search.SearchItem; public class SearchResults { - public ObjectArrayList items; + public ObjectArrayList items; public String nextpage; - public SearchResults(ObjectArrayList items, String nextpage) { + public SearchResults(ObjectArrayList items, String nextpage) { this.nextpage = nextpage; this.items = items; }