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

Remove unnecessary collector creation function from search extractor

parent 04bfa0ec
......@@ -52,7 +52,7 @@ public class InfoItemsSearchCollector extends InfoItemsCollector<InfoItem, InfoI
private final ChannelInfoItemsCollector userCollector;
private final PlaylistInfoItemsCollector playlistCollector;
InfoItemsSearchCollector(int serviceId) {
public InfoItemsSearchCollector(int serviceId) {
super(serviceId);
streamCollector = new StreamInfoItemsCollector(serviceId);
userCollector = new ChannelInfoItemsCollector(serviceId);
......
......@@ -27,10 +27,6 @@ public abstract class SearchExtractor extends ListExtractor<InfoItem> {
public abstract String getSearchSuggestion() throws ParsingException;
protected InfoItemsSearchCollector getInfoItemSearchCollector() {
return new InfoItemsSearchCollector(getService().getServiceId());
}
@Override
public SearchQueryHandler getLinkHandler() {
return (SearchQueryHandler) super.getLinkHandler();
......
......@@ -47,7 +47,7 @@ public class MediaCCCSearchExtractor extends SearchExtractor {
@Nonnull
@Override
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException {
final InfoItemsSearchCollector searchItems = getInfoItemSearchCollector();
final InfoItemsSearchCollector searchItems = new InfoItemsSearchCollector(getServiceId());
if (getLinkHandler().getContentFilters().contains(CONFERENCES)
|| getLinkHandler().getContentFilters().contains(ALL)
......
......@@ -47,8 +47,7 @@ public class PeertubeSearchExtractor extends SearchExtractor {
}
private InfoItemsCollector<InfoItem, InfoItemExtractor> collectStreamsFrom(JsonObject json) throws ParsingException {
final InfoItemsSearchCollector collector = getInfoItemSearchCollector();
final InfoItemsSearchCollector collector = new InfoItemsSearchCollector(getServiceId());
JsonArray contents;
try {
......
......@@ -78,7 +78,7 @@ public class SoundcloudSearchExtractor extends SearchExtractor {
}
private InfoItemsCollector<InfoItem, InfoItemExtractor> collectItems(JsonArray searchCollection) {
final InfoItemsSearchCollector collector = getInfoItemSearchCollector();
final InfoItemsSearchCollector collector = new InfoItemsSearchCollector(getServiceId());
for (Object result : searchCollection) {
if (!(result instanceof JsonObject)) continue;
......
......@@ -79,7 +79,7 @@ public class YoutubeSearchExtractor extends SearchExtractor {
@Nonnull
@Override
public InfoItemsPage<InfoItem> getInitialPage() throws ExtractionException {
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
final InfoItemsSearchCollector collector = new InfoItemsSearchCollector(getServiceId());
JsonArray sections = initialData.getObject("contents").getObject("twoColumnSearchResultsRenderer")
.getObject("primaryContents").getObject("sectionListRenderer").getArray("contents");
......@@ -103,7 +103,7 @@ public class YoutubeSearchExtractor extends SearchExtractor {
throw new ExtractionException(new IllegalArgumentException("Page url is empty or null"));
}
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
final InfoItemsSearchCollector collector = new InfoItemsSearchCollector(getServiceId());
final JsonArray ajaxJson = getJsonResponse(pageUrl, getExtractorLocalization());
JsonObject itemSectionRenderer = ajaxJson.getObject(1).getObject("response")
......
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