mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-06-27 15:43:07 +00:00
Allow creating PlayQueue from ListInfo and index
This commit is contained in:
parent
9bb2c0b484
commit
690b40d0c4
@ -28,13 +28,17 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo<? extends InfoItem>>
|
|||||||
private transient Disposable fetchReactor;
|
private transient Disposable fetchReactor;
|
||||||
|
|
||||||
protected AbstractInfoPlayQueue(final T info) {
|
protected AbstractInfoPlayQueue(final T info) {
|
||||||
|
this(info, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected AbstractInfoPlayQueue(final T info, final int index) {
|
||||||
this(info.getServiceId(), info.getUrl(), info.getNextPage(),
|
this(info.getServiceId(), info.getUrl(), info.getNextPage(),
|
||||||
info.getRelatedItems()
|
info.getRelatedItems()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(StreamInfoItem.class::isInstance)
|
.filter(StreamInfoItem.class::isInstance)
|
||||||
.map(StreamInfoItem.class::cast)
|
.map(StreamInfoItem.class::cast)
|
||||||
.collect(Collectors.toList()),
|
.collect(Collectors.toList()),
|
||||||
0);
|
index);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AbstractInfoPlayQueue(final int serviceId,
|
protected AbstractInfoPlayQueue(final int serviceId,
|
||||||
|
@ -16,6 +16,10 @@ public final class PlaylistPlayQueue extends AbstractInfoPlayQueue<PlaylistInfo>
|
|||||||
super(info);
|
super(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PlaylistPlayQueue(final PlaylistInfo info, final int index) {
|
||||||
|
super(info, index);
|
||||||
|
}
|
||||||
|
|
||||||
public PlaylistPlayQueue(final int serviceId,
|
public PlaylistPlayQueue(final int serviceId,
|
||||||
final String url,
|
final String url,
|
||||||
final Page nextPage,
|
final Page nextPage,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user