add getMoreInfo to SearchInfo
This commit is contained in:
parent
39332a283b
commit
2f351be772
|
@ -1,11 +1,15 @@
|
||||||
package org.schabi.newpipe.extractor.search;
|
package org.schabi.newpipe.extractor.search;
|
||||||
|
|
||||||
import org.schabi.newpipe.extractor.InfoItem;
|
import org.schabi.newpipe.extractor.InfoItem;
|
||||||
|
import org.schabi.newpipe.extractor.ListExtractor;
|
||||||
import org.schabi.newpipe.extractor.ListInfo;
|
import org.schabi.newpipe.extractor.ListInfo;
|
||||||
|
import org.schabi.newpipe.extractor.StreamingService;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
|
||||||
import org.schabi.newpipe.extractor.uih.SearchQIHandler;
|
import org.schabi.newpipe.extractor.uih.SearchQIHandler;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
public class SearchInfo extends ListInfo<InfoItem> {
|
public class SearchInfo extends ListInfo<InfoItem> {
|
||||||
|
|
||||||
private String searchString;
|
private String searchString;
|
||||||
|
@ -13,13 +17,13 @@ public class SearchInfo extends ListInfo<InfoItem> {
|
||||||
|
|
||||||
public SearchInfo(int serviceId,
|
public SearchInfo(int serviceId,
|
||||||
SearchQIHandler qIHandler,
|
SearchQIHandler qIHandler,
|
||||||
String searchString) throws ParsingException {
|
String searchString) {
|
||||||
super(serviceId, qIHandler, "Search");
|
super(serviceId, qIHandler, "Search");
|
||||||
this.searchString = searchString;
|
this.searchString = searchString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static SearchInfo getInfo(SearchExtractor extractor) throws ExtractionException {
|
public static SearchInfo getInfo(SearchExtractor extractor) {
|
||||||
final SearchInfo info = new SearchInfo(
|
final SearchInfo info = new SearchInfo(
|
||||||
extractor.getServiceId(),
|
extractor.getServiceId(),
|
||||||
extractor.getUIHandler(),
|
extractor.getUIHandler(),
|
||||||
|
@ -34,6 +38,15 @@ public class SearchInfo extends ListInfo<InfoItem> {
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static ListExtractor.InfoItemsPage<InfoItem> getMoreItems(StreamingService service,
|
||||||
|
SearchQIHandler query,
|
||||||
|
String contentCountry,
|
||||||
|
String pageUrl)
|
||||||
|
throws IOException, ExtractionException {
|
||||||
|
return service.getSearchExtractor(query, contentCountry).getPage(pageUrl);
|
||||||
|
}
|
||||||
|
|
||||||
// Getter
|
// Getter
|
||||||
public String getSearchString() {
|
public String getSearchString() {
|
||||||
return searchString;
|
return searchString;
|
||||||
|
|
Loading…
Reference in New Issue