Unverified Commit d72130ed authored by Mauricio Colli's avatar Mauricio Colli
Browse files

Always return a new item collector in the search extractor

parent 0c27198b
......@@ -17,11 +17,8 @@ public abstract class SearchExtractor extends ListExtractor<InfoItem> {
}
}
private final InfoItemsSearchCollector collector;
public SearchExtractor(StreamingService service, SearchQueryHandler linkHandler) {
super(service, linkHandler);
collector = new InfoItemsSearchCollector(service.getServiceId());
}
public String getSearchString() {
......@@ -31,7 +28,7 @@ public abstract class SearchExtractor extends ListExtractor<InfoItem> {
public abstract String getSearchSuggestion() throws ParsingException;
protected InfoItemsSearchCollector getInfoItemSearchCollector() {
return collector;
return new InfoItemsSearchCollector(getService().getServiceId());
}
@Override
......
......@@ -47,8 +47,7 @@ public class MediaCCCSearchExtractor extends SearchExtractor {
@Nonnull
@Override
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
InfoItemsSearchCollector searchItems = getInfoItemSearchCollector();
searchItems.reset();
final InfoItemsSearchCollector searchItems = getInfoItemSearchCollector();
if (getLinkHandler().getContentFilters().contains(CONFERENCES)
|| getLinkHandler().getContentFilters().contains(ALL)
......
......@@ -79,7 +79,6 @@ public class SoundcloudSearchExtractor extends SearchExtractor {
private InfoItemsCollector<InfoItem, InfoItemExtractor> collectItems(JsonArray searchCollection) {
final InfoItemsSearchCollector collector = getInfoItemSearchCollector();
collector.reset();
for (Object result : searchCollection) {
if (!(result instanceof JsonObject)) continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment