Allow creating PlayQueue from ListInfo and index
This commit is contained in:
parent
2bd2aaac9d
commit
6972384ec9
2 changed files with 9 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue