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()); List<Video> videos = DatabaseHelper.getVideosFromChannelIds(s, user.getSubscribed());
videos.forEach(video -> { videos.forEach(video -> {
feedItems.add(new FeedItem(video.getId(), video.getTitle(), rewriteURL(video.getThumbnail()), feedItems.add(new FeedItem("/watch?v=" + video.getId(), video.getTitle(),
video.getChannel().getUploaderId(), video.getChannel().getUploader(), rewriteURL(video.getThumbnail()), "/channel/" + video.getChannel().getUploaderId(),
rewriteURL(video.getChannel().getUploaderAvatar()), video.getViews(), video.getDuration(), video.getChannel().getUploader(), rewriteURL(video.getChannel().getUploaderAvatar()),
video.getUploaded(), video.getChannel().isVerified())); video.getViews(), video.getDuration(), video.getUploaded(),
video.getChannel().isVerified()));
}); });
Collections.sort(feedItems, (a, b) -> (int) (b.uploaded - a.uploaded)); 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 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 long views, duration, uploaded;
public boolean verified; 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) { String uploaderAvatar, long views, long duration, long uploaded, boolean verified) {
this.id = id; this.url = url;
this.title = title; this.title = title;
this.thumbnail = thumbnail; this.thumbnail = thumbnail;
this.uploader_id = uploader_id; this.uploaderUrl = uploaderUrl;
this.uploader = uploader; this.uploaderName = uploaderName;
this.uploaderAvatar = uploaderAvatar; this.uploaderAvatar = uploaderAvatar;
this.views = views; this.views = views;
this.duration = duration; this.duration = duration;