Add videos size to custom playlist response.

This commit is contained in:
Kavin 2022-04-06 16:29:30 +01:00
parent 76c5fe9273
commit 46d9dd1a2e
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -310,7 +310,9 @@ public class ResponseHelper {
final List<StreamItem> relatedStreams = new ObjectArrayList<>();
for (var video : pl.getVideos()) {
var videos = pl.getVideos();
for (var video : videos) {
var channel = video.getChannel();
relatedStreams.add(new StreamItem("/watch?v=" + video.getId(), video.getTitle(), rewriteURL(video.getThumbnail()), channel.getUploader(),
"/channel/" + channel.getUploaderId(), rewriteURL(channel.getUploaderAvatar()), null, null,
@ -318,7 +320,7 @@ public class ResponseHelper {
}
final Playlist playlist = new Playlist(pl.getName(), rewriteURL(pl.getThumbnail()), null, null, pl.getOwner().getUsername(),
null, null, -1, relatedStreams);
null, null, videos.size(), relatedStreams);
return Constants.mapper.writeValueAsBytes(playlist);
}