Skip to content

Commit 0c27198

Browse files
committed
Include errors from child collectors in the search collector
1 parent 2cf8cbf commit 0c27198

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/search/InfoItemsSearchCollector.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor;
1212
import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;
1313

14+
import java.util.ArrayList;
15+
import java.util.Collections;
16+
import java.util.List;
17+
1418
/*
1519
* Created by Christian Schabesberger on 12.02.17.
1620
*
@@ -55,6 +59,24 @@ public class InfoItemsSearchCollector extends InfoItemsCollector<InfoItem, InfoI
5559
playlistCollector = new PlaylistInfoItemsCollector(serviceId);
5660
}
5761

62+
@Override
63+
public List<Throwable> getErrors() {
64+
final List<Throwable> errors = new ArrayList<>(super.getErrors());
65+
errors.addAll(streamCollector.getErrors());
66+
errors.addAll(userCollector.getErrors());
67+
errors.addAll(playlistCollector.getErrors());
68+
69+
return Collections.unmodifiableList(errors);
70+
}
71+
72+
@Override
73+
public void reset() {
74+
super.reset();
75+
streamCollector.reset();
76+
userCollector.reset();
77+
playlistCollector.reset();
78+
}
79+
5880
@Override
5981
public InfoItem extract(InfoItemExtractor extractor) throws ParsingException {
6082
// Use the corresponding collector for each item extractor type

0 commit comments

Comments
 (0)