Always return a new item collector in the search extractor

This commit is contained in:
Mauricio Colli 2020-03-21 02:27:31 -03:00
parent 0c27198ba1
commit d72130edae
No known key found for this signature in database
GPG Key ID: F200BFD6F29DDD85
3 changed files with 2 additions and 7 deletions

View File

@ -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

View File

@ -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)

View File

@ -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;