Skip to content

Commit

Permalink
Merge pull request #816 from Bnyro/streams-uploaded-field
Browse files Browse the repository at this point in the history
feat: add uploaded timestamp to streams response
  • Loading branch information
Bnyro authored Jun 14, 2024
2 parents d67e50b + 49a9cd0 commit f378f43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/main/java/me/kavin/piped/utils/CollectionUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ public static Streams collectStreamInfo(StreamInfo info) {
)));

return new Streams(info.getName(), info.getDescription().getContent(),
info.getTextualUploadDate(), info.getUploaderName(), substringYouTube(info.getUploaderUrl()),
getLastThumbnail(info.getUploaderAvatars()), getLastThumbnail(info.getThumbnails()), info.getDuration(),
info.getViewCount(), info.getLikeCount(), info.getDislikeCount(), info.getUploaderSubscriberCount(), info.isUploaderVerified(),
info.getTextualUploadDate(), info.getUploadDate() != null ? info.getUploadDate().offsetDateTime().toInstant().toEpochMilli() : -1,
info.getUploaderName(), substringYouTube(info.getUploaderUrl()), getLastThumbnail(info.getUploaderAvatars()),
getLastThumbnail(info.getThumbnails()), info.getDuration(), info.getViewCount(), info.getLikeCount(), info.getDislikeCount(),
info.getUploaderSubscriberCount(), info.isUploaderVerified(),
audioStreams, videoStreams, relatedStreams, subtitles, livestream, rewriteVideoURL(info.getHlsUrl(), Map.of()),
rewriteVideoURL(info.getDashMpdUrl(), Map.of()), null, info.getCategory(), info.getLicence(),
info.getPrivacy().name().toLowerCase(), info.getTags(), metaInfo, chapters, previewFrames);
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/me/kavin/piped/utils/obj/Streams.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Streams {

public boolean uploaderVerified;

public long duration, views, likes, dislikes, uploaderSubscriberCount;
public long duration, views, likes, dislikes, uploaderSubscriberCount, uploaded;

public List<PipedStream> audioStreams, videoStreams;

Expand All @@ -33,7 +33,7 @@ public class Streams {

public List<PreviewFrames> previewFrames;

public Streams(String title, String description, String uploadDate, String uploader, String uploaderUrl,
public Streams(String title, String description, String uploadDate, long uploaded, String uploader, String uploaderUrl,
String uploaderAvatar, String thumbnailUrl, long duration, long views, long likes, long dislikes, long uploaderSubscriberCount,
boolean uploaderVerified, List<PipedStream> audioStreams, List<PipedStream> videoStreams,
List<ContentItem> relatedStreams, List<Subtitle> subtitles, boolean livestream, String hls, String dash,
Expand All @@ -42,6 +42,7 @@ public Streams(String title, String description, String uploadDate, String uploa
this.title = title;
this.description = description;
this.uploadDate = uploadDate;
this.uploaded = uploaded;
this.uploader = uploader;
this.uploaderUrl = uploaderUrl;
this.uploaderAvatar = uploaderAvatar;
Expand Down

0 comments on commit f378f43

Please sign in to comment.