mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Add videos size to custom playlist response.
This commit is contained in:
parent
76c5fe9273
commit
46d9dd1a2e
1 changed files with 4 additions and 2 deletions
|
@ -310,7 +310,9 @@ public class ResponseHelper {
|
||||||
|
|
||||||
final List<StreamItem> relatedStreams = new ObjectArrayList<>();
|
final List<StreamItem> relatedStreams = new ObjectArrayList<>();
|
||||||
|
|
||||||
for (var video : pl.getVideos()) {
|
var videos = pl.getVideos();
|
||||||
|
|
||||||
|
for (var video : videos) {
|
||||||
var channel = video.getChannel();
|
var channel = video.getChannel();
|
||||||
relatedStreams.add(new StreamItem("/watch?v=" + video.getId(), video.getTitle(), rewriteURL(video.getThumbnail()), channel.getUploader(),
|
relatedStreams.add(new StreamItem("/watch?v=" + video.getId(), video.getTitle(), rewriteURL(video.getThumbnail()), channel.getUploader(),
|
||||||
"/channel/" + channel.getUploaderId(), rewriteURL(channel.getUploaderAvatar()), null, null,
|
"/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(),
|
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);
|
return Constants.mapper.writeValueAsBytes(playlist);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue