Use Java streams in AbstractInfoPlayQueue
This commit is contained in:
parent
5f1f52b6ce
commit
4789cf6c31
|
@ -9,8 +9,8 @@ import org.schabi.newpipe.extractor.ListInfo;
|
||||||
import org.schabi.newpipe.extractor.Page;
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.core.SingleObserver;
|
import io.reactivex.rxjava3.core.SingleObserver;
|
||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
@ -132,10 +132,6 @@ abstract class AbstractInfoPlayQueue<T extends ListInfo<StreamInfoItem>>
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<PlayQueueItem> extractListItems(final List<StreamInfoItem> infoItems) {
|
private static List<PlayQueueItem> extractListItems(final List<StreamInfoItem> infoItems) {
|
||||||
final List<PlayQueueItem> result = new ArrayList<>();
|
return infoItems.stream().map(PlayQueueItem::new).collect(Collectors.toList());
|
||||||
for (final StreamInfoItem stream : infoItems) {
|
|
||||||
result.add(new PlayQueueItem(stream));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue