1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-04-06 02:37:18 +00:00

Allow creating PlayQueue from ListInfo and index

This commit is contained in:
Stypox 2025-02-16 08:55:51 +01:00
parent 9bb2c0b484
commit 690b40d0c4
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
2 changed files with 9 additions and 1 deletions

View File

@ -28,13 +28,17 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo<? extends InfoItem>>
private transient Disposable fetchReactor;
protected AbstractInfoPlayQueue(final T info) {
this(info, 0);
}
protected AbstractInfoPlayQueue(final T info, final int index) {
this(info.getServiceId(), info.getUrl(), info.getNextPage(),
info.getRelatedItems()
.stream()
.filter(StreamInfoItem.class::isInstance)
.map(StreamInfoItem.class::cast)
.collect(Collectors.toList()),
0);
index);
}
protected AbstractInfoPlayQueue(final int serviceId,

View File

@ -16,6 +16,10 @@ public final class PlaylistPlayQueue extends AbstractInfoPlayQueue<PlaylistInfo>
super(info);
}
public PlaylistPlayQueue(final PlaylistInfo info, final int index) {
super(info, index);
}
public PlaylistPlayQueue(final int serviceId,
final String url,
final Page nextPage,