Removed unused methods
``contentFilters`` and ``sortfilter`` are get inside the ``ListLinkHandler`` and not the ``ListLinkHandlerFactory`` ``ListLinkHandlerFactory`` only passes these values through when ``fromQuery`` is called
This commit is contained in:
parent
ec5b54c38b
commit
33347ac18b
4 changed files with 11 additions and 23 deletions
|
@ -1,5 +1,7 @@
|
|||
package org.schabi.newpipe.extractor.linkhandler;
|
||||
|
||||
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -25,14 +27,12 @@ public class ListLinkHandler extends LinkHandler {
|
|||
handler.sortFilter);
|
||||
}
|
||||
|
||||
public ListLinkHandler(final LinkHandler handler,
|
||||
final List<String> contentFilters,
|
||||
final String sortFilter) {
|
||||
public ListLinkHandler(final LinkHandler handler) {
|
||||
this(handler.originalUrl,
|
||||
handler.url,
|
||||
handler.id,
|
||||
contentFilters,
|
||||
sortFilter);
|
||||
Collections.emptyList(),
|
||||
EMPTY_STRING);
|
||||
}
|
||||
|
||||
public List<String> getContentFilters() {
|
||||
|
|
|
@ -13,16 +13,6 @@ public abstract class ListLinkHandlerFactory extends LinkHandlerFactory {
|
|||
// To Override
|
||||
///////////////////////////////////
|
||||
|
||||
@SuppressWarnings({"RedundantThrows", "unused"})
|
||||
public List<String> getContentFilter(final String url) throws ParsingException {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@SuppressWarnings({"RedundantThrows", "unused"})
|
||||
public String getSortFilter(final String url) throws ParsingException {
|
||||
return "";
|
||||
}
|
||||
|
||||
public abstract String getUrl(String id, List<String> contentFilter, String sortFilter)
|
||||
throws ParsingException;
|
||||
|
||||
|
@ -50,18 +40,17 @@ public abstract class ListLinkHandlerFactory extends LinkHandlerFactory {
|
|||
throw new IllegalArgumentException("url may not be null");
|
||||
}
|
||||
|
||||
return new ListLinkHandler(super.fromUrl(url, baseUrl), getContentFilter(url),
|
||||
getSortFilter(url));
|
||||
return new ListLinkHandler(super.fromUrl(url, baseUrl));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListLinkHandler fromId(final String id) throws ParsingException {
|
||||
return new ListLinkHandler(super.fromId(id), new ArrayList<>(0), "");
|
||||
return new ListLinkHandler(super.fromId(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListLinkHandler fromId(final String id, final String baseUrl) throws ParsingException {
|
||||
return new ListLinkHandler(super.fromId(id, baseUrl), new ArrayList<>(0), "");
|
||||
return new ListLinkHandler(super.fromId(id, baseUrl));
|
||||
}
|
||||
|
||||
public ListLinkHandler fromQuery(final String id,
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.schabi.newpipe.extractor.linkhandler;
|
|||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.schabi.newpipe.extractor.utils.Utils.EMPTY_STRING;
|
||||
|
@ -39,7 +40,7 @@ public abstract class SearchQueryHandlerFactory extends ListLinkHandlerFactory {
|
|||
}
|
||||
|
||||
public SearchQueryHandler fromQuery(final String query) throws ParsingException {
|
||||
return fromQuery(query, new ArrayList<>(0), EMPTY_STRING);
|
||||
return fromQuery(query, Collections.emptyList(), EMPTY_STRING);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -97,9 +97,7 @@ public final class YoutubePlaylistLinkHandlerFactory extends ListLinkHandlerFact
|
|||
}
|
||||
final String newUrl = "https://www.youtube.com/watch?v=" + videoID
|
||||
+ "&list=" + listID;
|
||||
return new ListLinkHandler(new LinkHandler(url, newUrl, listID),
|
||||
getContentFilter(url),
|
||||
getSortFilter(url));
|
||||
return new ListLinkHandler(new LinkHandler(url, newUrl, listID));
|
||||
}
|
||||
} catch (final MalformedURLException exception) {
|
||||
throw new ParsingException("Error could not parse URL: " + exception.getMessage(),
|
||||
|
|
Loading…
Reference in a new issue