Update field names for better reusablity.

This commit is contained in:
FireMasterK 2021-07-21 17:49:05 +05:30
parent e03f2661b4
commit 3d030b6968
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
2 changed files with 10 additions and 9 deletions

View file

@ -699,10 +699,11 @@ public class ResponseHelper {
List<Video> videos = DatabaseHelper.getVideosFromChannelIds(s, user.getSubscribed());
videos.forEach(video -> {
feedItems.add(new FeedItem(video.getId(), video.getTitle(), rewriteURL(video.getThumbnail()),
video.getChannel().getUploaderId(), video.getChannel().getUploader(),
rewriteURL(video.getChannel().getUploaderAvatar()), video.getViews(), video.getDuration(),
video.getUploaded(), video.getChannel().isVerified()));
feedItems.add(new FeedItem("/watch?v=" + video.getId(), video.getTitle(),
rewriteURL(video.getThumbnail()), "/channel/" + video.getChannel().getUploaderId(),
video.getChannel().getUploader(), rewriteURL(video.getChannel().getUploaderAvatar()),
video.getViews(), video.getDuration(), video.getUploaded(),
video.getChannel().isVerified()));
});
Collections.sort(feedItems, (a, b) -> (int) (b.uploaded - a.uploaded));

View file

@ -2,19 +2,19 @@ package me.kavin.piped.utils.obj;
public class FeedItem {
public String id, title, thumbnail, uploader_id, uploader, uploaderAvatar;
public String url, title, thumbnail, uploaderUrl, uploaderName, uploaderAvatar;
public long views, duration, uploaded;
public boolean verified;
public FeedItem(String id, String title, String thumbnail, String uploader_id, String uploader,
public FeedItem(String url, String title, String thumbnail, String uploaderUrl, String uploaderName,
String uploaderAvatar, long views, long duration, long uploaded, boolean verified) {
this.id = id;
this.url = url;
this.title = title;
this.thumbnail = thumbnail;
this.uploader_id = uploader_id;
this.uploader = uploader;
this.uploaderUrl = uploaderUrl;
this.uploaderName = uploaderName;
this.uploaderAvatar = uploaderAvatar;
this.views = views;
this.duration = duration;