Merged the latest changes

This commit is contained in:
Avently 2020-07-21 01:37:36 +03:00
commit 06e70abb86
47 changed files with 102 additions and 115 deletions

View file

@ -4,16 +4,12 @@ import org.schabi.newpipe.extractor.InfoItem;
import org.schabi.newpipe.extractor.ListInfo;
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class RelatedStreamInfo extends ListInfo<InfoItem> {
private StreamInfoItem nextStream;
public RelatedStreamInfo(final int serviceId, final ListLinkHandler listUrlIdHandler,
final String name) {
super(serviceId, listUrlIdHandler, name);
@ -25,20 +21,8 @@ public class RelatedStreamInfo extends ListInfo<InfoItem> {
RelatedStreamInfo relatedStreamInfo = new RelatedStreamInfo(
info.getServiceId(), handler, info.getName());
List<InfoItem> streams = new ArrayList<>();
if (info.getNextVideo() != null) {
streams.add(info.getNextVideo());
}
streams.addAll(info.getRelatedStreams());
relatedStreamInfo.setRelatedItems(streams);
relatedStreamInfo.setNextStream(info.getNextVideo());
return relatedStreamInfo;
}
public StreamInfoItem getNextStream() {
return nextStream;
}
public void setNextStream(final StreamInfoItem nextStream) {
this.nextStream = nextStream;
}
}