Remove unnecessary collector creation function from search extractor

This commit is contained in:
Mauricio Colli 2020-03-23 18:05:02 -03:00
parent 04bfa0ec6a
commit c921e5d6a5
No known key found for this signature in database
GPG Key ID: F200BFD6F29DDD85
6 changed files with 6 additions and 11 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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