Always return a new item collector in the search extractor
This commit is contained in:
parent
0c27198ba1
commit
d72130edae
|
@ -17,11 +17,8 @@ public abstract class SearchExtractor extends ListExtractor<InfoItem> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final InfoItemsSearchCollector collector;
|
|
||||||
|
|
||||||
public SearchExtractor(StreamingService service, SearchQueryHandler linkHandler) {
|
public SearchExtractor(StreamingService service, SearchQueryHandler linkHandler) {
|
||||||
super(service, linkHandler);
|
super(service, linkHandler);
|
||||||
collector = new InfoItemsSearchCollector(service.getServiceId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSearchString() {
|
public String getSearchString() {
|
||||||
|
@ -31,7 +28,7 @@ public abstract class SearchExtractor extends ListExtractor<InfoItem> {
|
||||||
public abstract String getSearchSuggestion() throws ParsingException;
|
public abstract String getSearchSuggestion() throws ParsingException;
|
||||||
|
|
||||||
protected InfoItemsSearchCollector getInfoItemSearchCollector() {
|
protected InfoItemsSearchCollector getInfoItemSearchCollector() {
|
||||||
return collector;
|
return new InfoItemsSearchCollector(getService().getServiceId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -47,8 +47,7 @@ public class MediaCCCSearchExtractor extends SearchExtractor {
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
|
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
|
||||||
InfoItemsSearchCollector searchItems = getInfoItemSearchCollector();
|
final InfoItemsSearchCollector searchItems = getInfoItemSearchCollector();
|
||||||
searchItems.reset();
|
|
||||||
|
|
||||||
if (getLinkHandler().getContentFilters().contains(CONFERENCES)
|
if (getLinkHandler().getContentFilters().contains(CONFERENCES)
|
||||||
|| getLinkHandler().getContentFilters().contains(ALL)
|
|| getLinkHandler().getContentFilters().contains(ALL)
|
||||||
|
|
|
@ -79,7 +79,6 @@ public class SoundcloudSearchExtractor extends SearchExtractor {
|
||||||
|
|
||||||
private InfoItemsCollector<InfoItem, InfoItemExtractor> collectItems(JsonArray searchCollection) {
|
private InfoItemsCollector<InfoItem, InfoItemExtractor> collectItems(JsonArray searchCollection) {
|
||||||
final InfoItemsSearchCollector collector = getInfoItemSearchCollector();
|
final InfoItemsSearchCollector collector = getInfoItemSearchCollector();
|
||||||
collector.reset();
|
|
||||||
|
|
||||||
for (Object result : searchCollection) {
|
for (Object result : searchCollection) {
|
||||||
if (!(result instanceof JsonObject)) continue;
|
if (!(result instanceof JsonObject)) continue;
|
||||||
|
|
Loading…
Reference in New Issue