From cf32a60ed1162181004247cabf5d7e2ca0c3165d Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 6 Feb 2022 15:33:46 +0000 Subject: [PATCH] Add uploaded field to StreamItem. (#183) --- src/main/java/me/kavin/piped/utils/ResponseHelper.java | 2 +- src/main/java/me/kavin/piped/utils/obj/StreamItem.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/kavin/piped/utils/ResponseHelper.java b/src/main/java/me/kavin/piped/utils/ResponseHelper.java index f77a481..bf8cfc0 100644 --- a/src/main/java/me/kavin/piped/utils/ResponseHelper.java +++ b/src/main/java/me/kavin/piped/utils/ResponseHelper.java @@ -1046,6 +1046,6 @@ public class ResponseHelper { return new StreamItem(substringYouTube(item.getUrl()), item.getName(), rewriteURL(item.getThumbnailUrl()), item.getUploaderName(), substringYouTube(item.getUploaderUrl()), rewriteURL(item.getUploaderAvatarUrl()), item.getTextualUploadDate(), item.getDuration(), - item.getViewCount(), item.isUploaderVerified()); + item.getViewCount(), item.getUploadDate() != null ? item.getUploadDate().offsetDateTime().toInstant().toEpochMilli() : -1, item.isUploaderVerified()); } } 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 4017b18..bf76e4e 100644 --- a/src/main/java/me/kavin/piped/utils/obj/StreamItem.java +++ b/src/main/java/me/kavin/piped/utils/obj/StreamItem.java @@ -3,11 +3,11 @@ package me.kavin.piped.utils.obj; public class StreamItem { public String url, title, thumbnail, uploaderName, uploaderUrl, uploaderAvatar, uploadedDate; - public long duration, views; + public long duration, views, uploaded; public boolean uploaderVerified; public StreamItem(String url, String title, String thumbnail, String uploaderName, String uploaderUrl, - String uploaderAvatar, String uploadedDate, long duration, long views, boolean uploaderVerified) { + String uploaderAvatar, String uploadedDate, long duration, long views, long uploaded, boolean uploaderVerified) { this.url = url; this.title = title; this.thumbnail = thumbnail; @@ -17,6 +17,7 @@ public class StreamItem { this.uploadedDate = uploadedDate; this.duration = duration; this.views = views; + this.uploaded = uploaded; this.uploaderVerified = uploaderVerified; } }